Example #1
0
        //Cellular Connection routines
        private void cellularRadio_GprsNetworkRegistrationChanged(CellularRadio sender,
                                                                  CellularRadio.NetworkRegistrationState networkState)
        {
            switch (networkState)
            {
            case CellularRadio.NetworkRegistrationState.Error:
                Debug.Print("Gprs Network Registration Changed - Error");
                break;

            case CellularRadio.NetworkRegistrationState.NotSearching:
                Debug.Print("Gprs Network Registration Changed - Not Searching");
                break;

            case CellularRadio.NetworkRegistrationState.Registered:
                Debug.Print("Gprs Network Registration Changed - Registered");
                cellularRadio.UseThisNetworkInterface(apn, username, password, PPPSerialModem.AuthenticationType.Pap);     //we have GPRS, so start up the PPP
                break;

            case CellularRadio.NetworkRegistrationState.RegistrationDenied:
                Debug.Print("Gprs Network Registration Changed - Registration Denied");
                break;

            case CellularRadio.NetworkRegistrationState.Roaming:
                Debug.Print("Gprs Network Registration Changed - Roaming");
                break;

            case CellularRadio.NetworkRegistrationState.Searching:
                Debug.Print("Gprs Network Registration Changed - Searching");
                break;

            case CellularRadio.NetworkRegistrationState.Unknown:
                Debug.Print("Gprs Network Registration Changed - Unknown");
                break;
            }
        }
Example #2
0
        public MessagesSender(CellularRadio cellular, NetworkConnector gsm)
        {
            this.numbersStack = new Stack();
            this.cellular     = cellular;
            this.gsm          = gsm;

            this.cellular.SmsSent += cellular_SmsSent;
        }
Example #3
0
        public NetworkConnector(CellularRadio gsm, Display_T35 display)
        {
            this.gsm     = gsm;
            this.display = display;
            gsm.GsmNetworkRegistrationChanged  += gsm_GsmNetworkRegistrationChanged;
            gsm.GprsNetworkRegistrationChanged += gsm_GprsNetworkRegistrationChanged;

            gsm.DebugPrintEnabled = true;
            gsm.PowerOn(1);
        }
Example #4
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);
     }
 }
Example #5
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;
        }
Example #6
0
        // Waiting for a trigger action - request of demo or work or incomming call.

        #region Registering / unregistering phone numbers
        // Incomming call event
        private void cellularRadio_IncomingCall(CellularRadio sender, string caller)
        {
            // Hanging incomming call
            this.cellularRadio.SendATCommand("ATH");

            // Removing '+' from caller id;
            if (caller[0] == '+')
            {
                caller = caller.Substring(1);
            }

            // Registering / unregistering contact
            int numberIndex = configManager.PhoneNumbers.IndexOf(caller);

            if (numberIndex >= 0)
            {
                configManager.PhoneNumbers.RemoveAt(numberIndex);
            }
            else
            {
                configManager.PhoneNumbers.Add(caller);
            }
        }
     //Cellular Connection routines
     private void cellularRadio_GprsNetworkRegistrationChanged(CellularRadio sender,
 CellularRadio.NetworkRegistrationState networkState)
     {
         switch (networkState)
         {
             case CellularRadio.NetworkRegistrationState.Error:
                 Debug.Print("Gprs Network Registration Changed - Error");
                 break;
             case CellularRadio.NetworkRegistrationState.NotSearching:
                 Debug.Print("Gprs Network Registration Changed - Not Searching");
                 break;
             case CellularRadio.NetworkRegistrationState.Registered:
                 Debug.Print("Gprs Network Registration Changed - Registered");
                 cellularRadio.UseThisNetworkInterface(apn, username, password, PPPSerialModem.AuthenticationType.Pap); //we have GPRS, so start up the PPP
                 break;
             case CellularRadio.NetworkRegistrationState.RegistrationDenied:
                 Debug.Print("Gprs Network Registration Changed - Registration Denied");
                 break;
             case CellularRadio.NetworkRegistrationState.Roaming:
                 Debug.Print("Gprs Network Registration Changed - Roaming");
                 break;
             case CellularRadio.NetworkRegistrationState.Searching:
                 Debug.Print("Gprs Network Registration Changed - Searching");
                 break;
             case CellularRadio.NetworkRegistrationState.Unknown:
                 Debug.Print("Gprs Network Registration Changed - Unknown");
                 break;
         }
     }
Example #8
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);
 }
Example #9
0
 private void cellular_SmsSent(CellularRadio sender, bool success, string messageReference)
 {
     Thread.Sleep(5000);
     this.sendMessage();
 }
Example #10
0
 private void CellularRadio_PhoneActivityRequested(CellularRadio sender, CellularRadio.PhoneActivity activity)
 {
     Debug.Print("activity:"+activity.ToString());
 }
Example #11
0
 private void CellularRadio_OperatorRequested(CellularRadio sender, string operatorName)
 {
     Debug.Print(operatorName);
 }
Example #12
0
 private void CellularRadio_IncomingCall(CellularRadio sender, string caller)
 {
     Debug.Print("Telp masuk");
 }
Example #13
0
 private void CellularRadio_GsmNetworkRegistrationChanged(CellularRadio sender, CellularRadio.NetworkRegistrationState networkState)
 {
     Debug.Print(networkState.ToString());
 }
Example #14
0
 private void gsm_GsmNetworkRegistrationChanged(CellularRadio sender, CellularRadio.NetworkRegistrationState networkState)
 {
     this.gsmState = networkState;
 }