Beispiel #1
0
        // Method No. 2
        private void sdCardController_CardMounted(SDCard sender, SDCardController sdController)
        {
            display.SimpleGraphics.Clear();
            display.SimpleGraphics.DisplayText("SD card mounted", font, GT.Color.Red, 0, 0);

            // Reading config
            string configText = sdController.GetTextFile(CONFIG_FILENAME);

            this.configManager = new ConfigManager(configText);

            this.emptyTemplate = sdController.GetTemplate(this.configManager.EmptyTemplatePath);

            if (this.emptyTemplate == null)
            {
                display.SimpleGraphics.Clear();
                display.SimpleGraphics.DisplayText("Template not found. Reload required.", font, GT.Color.Red, 0, 0);
                throw new EGDNoTemplateFile("Could not load template file. Check SD card content if EMPTY_TEMPLATE_FILENAME exists.");
            }

            // SD card initialized
            // Initializing GSM network

            this.gsm = new NetworkConnector(cellularRadio, display);
            this.gsm.NetworkRegistered += gsm_NetworkRegistered;
            this.gsm.EnsureNetwork();

            // Async code. End point: Method No. 3
        }
Beispiel #2
0
        public MessagesSender(CellularRadio cellular, NetworkConnector gsm)
        {
            this.numbersStack = new Stack();
            this.cellular     = cellular;
            this.gsm          = gsm;

            this.cellular.SmsSent += cellular_SmsSent;
        }
Beispiel #3
0
 public void OnMessagesDelivered(CellularRadio cellural, NetworkConnector gsm)
 {
     if (onMessagesDelivered == null)
     {
         onMessagesDelivered = new MessageDeliveredHandler(MessagesDelivered);
     }
     if (Program.CheckAndInvoke(MessagesDelivered, onMessagesDelivered, cellular, gsm))
     {
         MessagesDelivered(cellular, gsm);
     }
 }
Beispiel #4
0
        // Method No. 3
        private void gsm_NetworkRegistered(CellularRadio sender, NetworkConnector controller)
        {
            display.SimpleGraphics.Clear();
            display.SimpleGraphics.DisplayText("Connected to network", font, GT.Color.Red, 0, 0);

            this.cellularRadio.IncomingCall += cellularRadio_IncomingCall;

            // Initialing connected module
            // Enable incoming call information
            cellularRadio.SendATCommand("AT+CLIP=1");
            this.messagesSender = new MessagesSender(this.cellularRadio, this.gsm);
            this.messagesSender.MessagesDelivered += messagesSender_MessagesDelivered;

            // Async code. End point Method 4.
            this.cameraController = new CameraController(camera, display);
            this.cameraController.CameraInitialized += cameraController_CameraInitialized;
        }
Beispiel #5
0
 // All messages delivered
 private void messagesSender_MessagesDelivered(CellularRadio cellular, NetworkConnector gsm)
 {
     display.SimpleGraphics.Clear();
     display.SimpleGraphics.DisplayText("All messages delivered.", font, GT.Color.Red, 0, 0);
 }