3 Replies Latest reply on Apr 23, 2014 9:47 PM by Sushil Gusain

    SB1 - unique identifier and confirm prompt

    Bob Walker

      1 - is there a way to get a unique identifier for the badge the application is running on?  For logging purposes I need to be able to identify which device issued a command.

       

      2 - The confirm box shows an 'OK' and 'Cancel' button.  I need to be able to determine if the OK or Cancel was pressed but it appears that the callback only returns on a good response. (at least according to the documentation)  Can I determine which button was pressed or am I going to have to implement my own multiple choice message box that will pass back what was selected.

        • Re: SB1 - unique identifier and confirm prompt
          Mark Jolley

          Hi Bob,


          For point 1 I have used the MAC address to determine which device is being used for things like this use Signal.MacAddress for this - Rhomobile | Signal Module

          For point 2 I believe you can put a callback on each button to return to a certain command MJH468 can you confirm that

           

          Mark

          • Re: SB1 - unique identifier and confirm prompt
            Bob Walker

            Using the mac address did not work for me because I could not guarantee that I got the mac address prior to the web service call.  I was able to use generic.UUID to get the uuid of the sb1 and use it.

             

            For the callback, all I eventually needed was to have the callback get the bool status passed in so I could tell if the user hit the OK button or the Cancel button.

             

            The SB1 is a neat little product but the documentation is pretty poor as to what I've seen from Motorola in the past.  Even links that reference the Rho components are outdated or in some cases not applicable to the sb1.

            • Re: SB1 - unique identifier and confirm prompt
              Sushil Gusain

              Hi,

              use MAC Address to identifier

              using this script to find MAC Address-

              function signal_test(){ 

                           signal.signalEvent = "Javascript:get_signal_events(%json);"; 

                } 

                function get_signal_events(jsonObj){ 

                var macaddr = jsonObj.macAddress; 

                signal.signalEvent = ""; //Clear the signal event so it doesnt fire again 

                if (window.XMLHttpRequest) 

                { 

                                    var xhr = new window.XMLHttpRequest(); 

                                     //xhr.open("GET", '/app/Settings/macaddress?macaddr='+encodeURIComponent(macaddr), true); 

                                    //xhr.send(null); 

                 var str = encodeURIComponent(macaddr).replace(/%/gi,":");

                 alert(str);

                }else 

                { 

                                    var xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP"); 

                                    //xmlHttpReq.open("GET", '/app/Settings/macaddress?macaddr='+encodeURIComponent(macaddr), true); 

                                    //xmlHttpReq.send();

                 var str = encodeURIComponent(macaddr).replace(/%/gi,":");

                 alert(str);

                } 

                }