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.

CCS: CC3200 Launchpad

Other Parts Discussed in Thread: CC3200, CC3100

Tool/software: Code Composer Studio

Hi,

In order to connect to the internet, we enter SSID, Security type etc on this HTML page. We also enter Device configuration. All this is flashed onto the board. What I want to know is how to read all these parameters from the code. I am aware there are file operation APIs. But I don't know which one to use. 
I want to read the flashed SSID and Device Name i.e, "TestUnit" on code composer studio. 
Please help me out!

Thanks,
Alisha

  • Hi Alisha,

    I believe what you are looking for are the WLAN device configuration APIs. Take a look at this chapter in the CC3100/CC3200 User's Guide: http://www.ti.com/lit/swru368

    You can also find an API guide in the SDK documentation: docs/simplelink_api/programmers_guide.html

    Best regards,
    Sarah
  • Hey Sarah,

    Thanks! But I would also like to access "Device Name"...Can't seem to find any variable or API to access it.

    Alisha
  • Hi Alisha,

    The device name is also called the device URN. This can be retrieved with sl_NetAppGet().

    Best regards,
    Sarah
  • Hi Sarah,
    I actually did give that API a try multiple times. But it never seems to return 0. It returns -2002. And nothing is being stored in the string variable I assigned to it, apart from junk.

    _u8 my_device_name[50];
    int lRetVal = -1;
    unsigned char len = strlen((const char *)my_device_name);

    lRetVal = sl_NetAppGet (SL_NET_APP_DEVICE_CONFIG_ID, NETAPP_SET_GET_DEV_CONF_OPT_DOMAIN_NAME, len, (_u8 *)my_device_name);


    Do I have to call any function before using this API?

    I am invoking this API in the 'SimpleLinkNetAppEventHandler' under 'case SL_NETAPP_IPV4_IPACQUIRED_EVENT: '
  • Hi Alisha,

    That error is listed in device.h:

    /* Receive this error in case zero length is supplied to a "get" API
       Recommend to supply length according to requested information (view options defines for help) */
    #define SL_EZEROLEN      (-2002)

    You should use sizeof() instead of strlen() in this case. The buffer is empty, so you are likely passing zero to the API. Also be aware of the 32 character limitation for the URN.

    If you would like to set the device name, you must use sl_NetAppSet().

    Best regards,

    Sarah

  • Hi Sarah,

    I am not using sl_NetAppSet() because I have already set the URN name in the setup.html page. All I want to do is to read that name by using GET. But yes, the buffer seems to be empty.

    Thanks,
    Alisha
  • Hi Sarah,

    It worked. Thanks a lot!

    Alisha