TI中文支持网
TI专业的中文技术问题搜集分享网站

CC3235在程序中存储应用信息

您好,希望在程序运行后,修改连接AP的SSID和密码,并且能够保存,这样下次上电运行,就可以读出这些信息,并且还需要保存一些其他的应用参数。这些参数应该可以通过程序 保存在 SPI接口的FLASH中。但是文档中似乎找不到  在程序中保存自定义参数的 方法,如果有,求指点!!

Alvin Chen:

使用

sl_WlanProfileAdd() 去添加

http://dev.ti.com/tirex/content/simplelink_cc32xx_sdk_1_40_00_03/docs/wifi_host_driver_api/html/group___wlan.html#ga44a1d4682ee9bb32b586a4f246859b81

https://e2echina.ti.com/question_answer/wireless_connectivity/wifi/f/105/p/124402/413242?tisearch=e2e-quicksearch&keymatch=sl_WlanProfileAdd()#413242

user4881643:

回复 Alvin Chen:

您好,我不仅仅要存储WLAN的一些信息,我还要存储一些其他的个人信息,请问有什么方法,我用了sl_FsOpen、 sl_FsWrite去操作,发现经常操作不成功,参考的是dev.ti.com/…/group___file_system.html

Alvin Chen:

回复 user4881643:

char*DeviceFileName = "MyFile.txt";
unsigned longMaxSize = 63 * 1024; //62.5K is max file size
longDeviceFileHandle = -1;
_i32RetVal;//negative retval is an error
unsigned longOffset = 0;
unsigned charInputBuffer[100];
_u32 MasterToken = 0;
// Create a file and write data. The file in this example is secured, without signature and with a fail safe commit
//create a secure file if not exists and open it for write.
DeviceFileHandle =sl_FsOpen(unsigned char *)DeviceFileName,SL_FS_CREATE|SL_FS_OVERWRITE | SL_FS_CREATE_SECURE | SL_FS_CREATE_NOSIGNATURE | SL_FS_CREATE_MAX_SIZE( MaxSize ),&MasterToken);
Offset = 0;
//Preferred in secure file that the Offset and the length will be aligned to 16 bytes.
RetVal = sl_FsWrite( DeviceFileHandle, Offset, (unsigned char *)"HelloWorld", strlen("HelloWorld"));
RetVal = sl_FsClose(DeviceFileHandle, NULL, NULL , 0);
// open the same file for read, using the Token we got from the creation procedure above
DeviceFileHandle =sl_FsOpen(unsigned char *)DeviceFileName,SL_FS_READ,&MasterToken);
Offset = 0;
RetVal = sl_FsRead( DeviceFileHandle, Offset, (unsigned char *)InputBuffer, strlen("HelloWorld"));
RetVal = sl_FsClose(DeviceFileHandle, NULL, NULL , 0);

上面的程序也不可以吗?

赞(0)
未经允许不得转载:TI中文支持网 » CC3235在程序中存储应用信息
分享到: 更多 (0)