Esempio n. 1
0
        public static void Write(XBeeApi sender, XBeeAddress remoteXbee, ApiModes mode)
        {
            var request = sender.Send(AtCmd.ApiEnable, new[] {(byte) mode}).To(remoteXbee);
            var response = (AtResponse) request.GetResponse();

            if (!response.IsOk)
                throw new XBeeException("Failed to write api mode");
        }
Esempio n. 2
0
        public static void Write(XBeeApi xbee, ApiModes mode)
        {
            var request = xbee.Send(AtCmd.ApiEnable, new[] {(byte) mode});
            var response = request.GetResponse();

            if (!response.IsOk)
                throw new XBeeException("Failed to write api mode");
        }
Esempio n. 3
0
        public static void Write(XBeeApi sender, XBeeAddress remoteXbee, ApiModes mode)
        {
            var request  = sender.Send(AtCmd.ApiEnable, new[] { (byte)mode }).To(remoteXbee);
            var response = (AtResponse)request.GetResponse();

            if (!response.IsOk)
            {
                throw new XBeeException("Failed to write api mode");
            }
        }
Esempio n. 4
0
        public static void Write(XBeeApi xbee, ApiModes mode)
        {
            var request  = xbee.Send(AtCmd.ApiEnable, new[] { (byte)mode });
            var response = request.GetResponse();

            if (!response.IsOk)
            {
                throw new XBeeException("Failed to write api mode");
            }
        }
        public void SetApiMode(ApiModes apiMode)
        {
            if (_remoteXbee != null)
            {
                Common.ApiMode.Write(_xbee, _remoteXbee, apiMode);
            }
            else
            {
                Common.ApiMode.Write(_xbee, apiMode);
            }

            ApiMode = apiMode;
        }
Esempio n. 6
0
 public async Task InitializeAsync()
 {
     if (_storageHelper.KeyExists(current_api_key))
     {
         var config = _storageHelper.Read <ApiConfig>(current_api_key);
         CurrentApiMode = ApiModes.FirstOrDefault(i => i.ApiConfig == config);
     }
     if (CurrentApiMode == null)
     {
         CurrentApiMode = ApiModes.First();
         _storageHelper.Save(current_api_key, CurrentApiMode.ApiConfig);
     }
     await rebuildForumListAsync(CurrentApiMode.ApiConfig);
 }
Esempio n. 7
0
 public static string GetName(ApiModes apiMode)
 {
     return((string)ApiModeNames[apiMode]);
 }
Esempio n. 8
0
 public static string GetName(ApiModes apiMode)
 {
     return (string)ApiModeNames[apiMode];
 }
Esempio n. 9
0
        public void SetApiMode(ApiModes apiMode)
        {
            if (_remoteXbee != null)
            {
                Common.ApiMode.Write(_xbee, _remoteXbee, apiMode);
            }
            else
            {
                Common.ApiMode.Write(_xbee, apiMode);
            }

            ApiMode = apiMode;
        }