summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/hciattach_st.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/tools/hciattach_st.c b/tools/hciattach_st.c
index 47df4fe18..f2be66f52 100644
--- a/tools/hciattach_st.c
+++ b/tools/hciattach_st.c
@@ -195,40 +195,36 @@ int stlc2500_init(int dd, bdaddr_t *bdaddr)
uint16_t version;
int len;
- len = do_command(dd, 0x04, 0x0001, NULL, 0, buf, sizeof(buf));
+ /* Hci_Cmd_Ericsson_Read_Revision_Information */
+ len = do_command(dd, 0xff, 0x000f, NULL, 0, buf, sizeof(buf));
if (len < 0)
return -1;
- version = buf[2] << 8 | buf[1];
-
- if (load_file(dd, version, ".ptc") < 0)
- return -1;
+ printf("%s\n", buf);
- len = do_command(dd, 0x03, 0x0003, NULL, 0, buf, sizeof(buf));
+ /* HCI_Read_Local_Version_Information */
+ len = do_command(dd, 0x04, 0x0001, NULL, 0, buf, sizeof(buf));
if (len < 0)
return -1;
- if (load_file(dd, buf[2] << 8 | buf[1], ".ssf") < 0)
- return -1;
+ version = buf[2] << 8 | buf[1];
- len = do_command(dd, 0x03, 0x0003, NULL, 0, buf, sizeof(buf));
- if (len < 0)
+ if (load_file(dd, version, ".ptc") < 0)
return -1;
- len = do_command(dd, 0xff, 0x000f, NULL, 0, buf, sizeof(buf));
- if (len < 0)
+ if (load_file(dd, buf[2] << 8 | buf[1], ".ssf") < 0)
return -1;
- printf("%s\n", buf);
-
cmd[0] = 0xfe;
cmd[1] = 0x06;
bacpy((bdaddr_t *) (cmd + 2), bdaddr);
+ /* Hci_Cmd_ST_Store_In_NVDS */
len = do_command(dd, 0xff, 0x0022, cmd, 8, buf, sizeof(buf));
if (len < 0)
return -1;
+ /* HCI_Reset : applies parameters*/
len = do_command(dd, 0x03, 0x0003, NULL, 0, buf, sizeof(buf));
if (len < 0)
return -1;