summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTonyCave2013-12-19 14:44:44 -0600
committerTonyCave2013-12-19 14:44:44 -0600
commit35ed3de4ec321f32b5c7ee19cd6ea0ba26a40213 (patch)
tree15c29bb3f23f04b7ad42371e053c91030bad9c84
parent86e1a045561c24b5bb1e0995ed6b1c7e08b10d90 (diff)
downloadlighting-gateway-master.tar.gz
lighting-gateway-master.tar.xz
lighting-gateway-master.zip
Fixed boot command to work with old and new bootloaderHEADmaster
-rw-r--r--zbSocDriver/.zbSocCmd.c.swpbin0 -> 16384 bytes
-rwxr-xr-xzbSocDriver/zbSocCmd.c12
2 files changed, 7 insertions, 5 deletions
diff --git a/zbSocDriver/.zbSocCmd.c.swp b/zbSocDriver/.zbSocCmd.c.swp
new file mode 100644
index 0000000..5ebc0db
--- /dev/null
+++ b/zbSocDriver/.zbSocCmd.c.swp
Binary files differ
diff --git a/zbSocDriver/zbSocCmd.c b/zbSocDriver/zbSocCmd.c
index 22d8fd1..9eb1a01 100755
--- a/zbSocDriver/zbSocCmd.c
+++ b/zbSocDriver/zbSocCmd.c
@@ -169,6 +169,9 @@ len, /*RPC payload Len */ \
169/*******************************/ 169/*******************************/
170#define SB_FORCE_BOOT 0xF8 170#define SB_FORCE_BOOT 0xF8
171#define SB_FORCE_RUN (SB_FORCE_BOOT ^ 0xFF) 171#define SB_FORCE_RUN (SB_FORCE_BOOT ^ 0xFF)
172#define SB_FORCE_BOOT_1 0x10
173#define SB_FORCE_RUN_1 (SB_FORCE_BOOT_1 ^ 0xFF)
174
172 175
173typedef enum { 176typedef enum {
174 MT_RPC_CMD_POLL = 0x00, 177 MT_RPC_CMD_POLL = 0x00,
@@ -298,8 +301,8 @@ int32_t zbSocOpen(char *devicePath)
298 tcsetattr(serialPortFd, TCSANOW, &tio); 301 tcsetattr(serialPortFd, TCSANOW, &tio);
299 302
300 //Send the bootloader force boot incase we have a bootloader that waits 303 //Send the bootloader force boot incase we have a bootloader that waits
301 uint8_t forceBoot = SB_FORCE_RUN; 304 uint8_t forceBoot[] = {SB_FORCE_RUN, SB_FORCE_RUN_1};
302 zbSocTransportWrite(&forceBoot, 1); 305 zbSocTransportWrite(forceBoot, 2);
303 306
304 return serialPortFd; 307 return serialPortFd;
305} 308}
@@ -1519,7 +1522,7 @@ void processRpcSysZdo(uint8_t *rpcBuff)
1519 } 1522 }
1520 else 1523 else
1521 { 1524 {
1522 printf("processRpcSysZdo: Unsupported MT ZDO Msg\n"); 1525 //printf("processRpcSysZdo: Unsupported MT ZDO Msg\n");
1523 } 1526 }
1524 1527
1525 return; 1528 return;
@@ -1677,8 +1680,7 @@ void zbSocProcessRpc(void)
1677 1680
1678 default: 1681 default:
1679 { 1682 {
1680 printf("zbSocProcessRpc: CMD0:%x, CMD1:%x, not handled\n", rpcBuff[0], 1683 //printf("zbSocProcessRpc: CMD0:%x, CMD1:%x, not handled\n", rpcBuff[0] , rpcBuff[1])
1681 rpcBuff[1]);
1682 break; 1684 break;
1683 } 1685 }
1684 } 1686 }