public async Task<BluetoothRobotConstants.ACTIVIATION_STATUS> ReadProductActivationStatus()
        {
            if (activationStatus == BluetoothRobotConstants.ACTIVIATION_STATUS.NOT_READ)
            {
                byte[] data = await base.ReadChacateristicValueAsync(BluetoothRobotConstants.DEVICE_SETTING_PRODUCT_ACTIVIATION_CHARACTERISTIC_UUID);
                activationStatus = BaseService.ConvertEnumFromBytes<BluetoothRobotConstants.ACTIVIATION_STATUS>(data);
            }

            return activationStatus;
        }
Exemplo n.º 2
0
        public async Task <BluetoothRobotConstants.ACTIVIATION_STATUS> ReadProductActivationStatus()
        {
            if (activationStatus == BluetoothRobotConstants.ACTIVIATION_STATUS.NOT_READ)
            {
                byte[] data = await base.ReadChacateristicValueAsync(BluetoothRobotConstants.DEVICE_SETTING_PRODUCT_ACTIVIATION_CHARACTERISTIC_UUID);

                activationStatus = BaseService.ConvertEnumFromBytes <BluetoothRobotConstants.ACTIVIATION_STATUS>(data);
            }

            return(activationStatus);
        }
Exemplo n.º 3
0
 public async Task <bool> WriteProductActivationStatus(BluetoothRobotConstants.ACTIVIATION_STATUS status)
 {
     return(await base.WriteCharacteristicValueAsync(BluetoothRobotConstants.DEVICE_SETTING_PRODUCT_ACTIVIATION_CHARACTERISTIC_UUID, new byte[] { (byte)status }));
 }
Exemplo n.º 4
0
        //private functions

        private IAsyncAction SetMipProductionActivation(BluetoothRobotConstants.ACTIVIATION_STATUS status)
        {
            ToyActivationStatus = status;
            return(SendMipCommand(MipRobotConstants.COMMAND_CODE.SET_TOY_ACTIVATED_STATUS, (byte)status).AsAsyncAction());
        }
Exemplo n.º 5
0
 public Task <bool> SetBTProductActiviationStatus(BluetoothRobotConstants.ACTIVIATION_STATUS status)
 {
     return(GetService <DeviceSettingService>(BaseService.TYPE.DEVICE_SETTING).WriteProductActivationStatus(status));
 }