Skip to content

Commit

Permalink
Update the data channel ID. (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariachen authored May 23, 2018
1 parent da616bb commit 252b702
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions content/en/tutorial/7688_led_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ The server sends commands in the following format: deviceId, deviceKey, timesta
while True:
command = commandChannel.recv(1024)
logging.info("recv:" + command)
# command can be a response of heart beat or an update of the LED_control,
# command can be a response of heart beat or an update of the LED_Control,
# so we split by ',' and drop device id and device key and check length
fields = command.split(',')[2:]

if len(fields) > 1:
timeStamp, dataChannelId, commandString = fields
if dataChannelId == 'LED_control':
if dataChannelId == 'LED_Control':
# check the value - it's either 0 or 1
commandValue = int(commandString)
logging.info("led :%d" % commandValue)
Expand Down Expand Up @@ -312,13 +312,13 @@ def waitAndExecuteCommand(commandChannel):
while True:
command = commandChannel.recv(1024)
logging.info("recv:" + command)
# command can be a response of heart beat or an update of the LED_control,
# command can be a response of heart beat or an update of the LED_Control,
# so we split by ',' and drop device id and device key and check length
fields = command.split(',')[2:]

if len(fields) > 1:
timeStamp, dataChannelId, commandString = fields
if dataChannelId == 'LED_control':
if dataChannelId == 'LED_Control':
# check the value - it's either 0 or 1
commandValue = int(commandString)
logging.info("led :%d" % commandValue)
Expand Down
8 changes: 4 additions & 4 deletions content/zh-CN/tutorial/7688_led_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ The server sends commands in the following format: deviceId, deviceKey, timesta
while True:
command = commandChannel.recv(1024)
logging.info("recv:" + command)
# command can be a response of heart beat or an update of the LED_control,
# command can be a response of heart beat or an update of the LED_Control,
# so we split by ',' and drop device id and device key and check length
fields = command.split(',')[2:]

if len(fields) > 1:
timeStamp, dataChannelId, commandString = fields
if dataChannelId == 'LED_control':
if dataChannelId == 'LED_Control':
# check the value - it's either 0 or 1
commandValue = int(commandString)
logging.info("led :%d" % commandValue)
Expand Down Expand Up @@ -312,13 +312,13 @@ def waitAndExecuteCommand(commandChannel):
while True:
command = commandChannel.recv(1024)
logging.info("recv:" + command)
# command can be a response of heart beat or an update of the LED_control,
# command can be a response of heart beat or an update of the LED_Control,
# so we split by ',' and drop device id and device key and check length
fields = command.split(',')[2:]

if len(fields) > 1:
timeStamp, dataChannelId, commandString = fields
if dataChannelId == 'LED_control':
if dataChannelId == 'LED_Control':
# check the value - it's either 0 or 1
commandValue = int(commandString)
logging.info("led :%d" % commandValue)
Expand Down
8 changes: 4 additions & 4 deletions content/zh-TW/tutorial/7688_led_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ The server sends commands in the following format: deviceId, deviceKey, timesta
while True:
command = commandChannel.recv(1024)
logging.info("recv:" + command)
# command can be a response of heart beat or an update of the LED_control,
# command can be a response of heart beat or an update of the LED_Control,
# so we split by ',' and drop device id and device key and check length
fields = command.split(',')[2:]

if len(fields) > 1:
timeStamp, dataChannelId, commandString = fields
if dataChannelId == 'LED_control':
if dataChannelId == 'LED_Control':
# check the value - it's either 0 or 1
commandValue = int(commandString)
logging.info("led :%d" % commandValue)
Expand Down Expand Up @@ -312,13 +312,13 @@ def waitAndExecuteCommand(commandChannel):
while True:
command = commandChannel.recv(1024)
logging.info("recv:" + command)
# command can be a response of heart beat or an update of the LED_control,
# command can be a response of heart beat or an update of the LED_Control,
# so we split by ',' and drop device id and device key and check length
fields = command.split(',')[2:]

if len(fields) > 1:
timeStamp, dataChannelId, commandString = fields
if dataChannelId == 'LED_control':
if dataChannelId == 'LED_Control':
# check the value - it's either 0 or 1
commandValue = int(commandString)
logging.info("led :%d" % commandValue)
Expand Down

0 comments on commit 252b702

Please sign in to comment.