This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cc2541 bt address 想要秀在device monitor欄位上



Dear TI,

我知道下面那段code是可以得知device BT address,因為我有用uart 印出來驗證過.

但現在我想要在連上device monitor上更改serial Number string這個欄位想要秀出bt address?

請問有什麼方法嗎?

// use 6 bytes of device address for 8 bytes of system ID value
systemId[0] = ownAddress[0];
systemId[1] = ownAddress[1];
systemId[2] = ownAddress[2];

// set middle bytes to zero
systemId[4] = 0x00;
systemId[3] = 0x00;

// shift three bytes up
systemId[7] = ownAddress[5];
systemId[6] = ownAddress[4];
systemId[5] = ownAddress[3];


DevInfo_SetParameter(DEVINFO_SYSTEM_ID, DEVINFO_SYSTEM_ID_LEN, systemId);

Thanks a lot 

Ben

  • ben,

    如果想要通过device monitor读出相应信息,需要你在相应的characteristic value里面有保存相应信息。

    你可以把你的device information 保存到你自己定义的一个characteristic value中。

    不知道我是否理解了你的意思,并回答了?

  • Dear Yan,

    因為我已知ownAddress會存在systemID的array裡面了在sensortag.c的檔案

    可是我不太清楚要如何把systemID array pass到static const uint8 devInfoSerialNumber[]這個array

    可否問一下做的方法? 假設bt address是 aa:bb:cc:dd:ee 我想要放在那個Serial Number欄位裡

    謝謝.

    Ben

  • ben,

    你需要做的只是自己定义 devInfoSerialNumber[] 这个array, 或者copy你需要的serial number 到这个array 里面。

    请忽略TI 代码里面默认的"Serial Number"; 这个定义。

  • Dear Yan,

    謝謝你的回信,不過你說的那個方法我想說應該是寫死的,畢竟我還要去做fuction去讀取address array. 或許是我不太能理解你的方法...

    但我自己的解法是寫在NVram裡面在透過nvram直接讀取...雖然感覺比你還費工夫

    謝謝你哦,Yan

    Ben

  • ben,

    完全可以照你的方法去做。

    你可以动态改变system ID的内容,去达到目的:)