summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-10-09 16:51:17 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-10-09 16:51:17 +0000
commitebc48fedda3e9220862c53e2d9afe8b50f14c1a3 (patch)
treef2b70fd84be3722387ff129501460300e99d2d15 /tools
parent2d49c5ba27bd59638a3fb6e357beae609d4eb27a (diff)
Change init sequence and add comments
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 47df4fe1..f2be66f5 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;