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.

CC3220SF-LAUNCHXL: Get Network Device Name on Out of Box solution when calling setDeviceNameFromUrl from mobile app

Part Number: CC3220SF-LAUNCHXL

On the 3220SF side, I'd like to receive the network name that the mobile client is sending via SimpleLinkNetworkUtil.m setDeviceNameFromUrl function.

I have an iOS application that it using the Out of Box provisioning and the AWS Iot SDK integrated and I'd like to either use the above name being set to the device, but not sure what API or code on the C side to look at receiving that function coming in from the endpoint.

Here's some of the code from the mobile app..

+ (void)setDeviceNameFromUrl:(NSString*)baseUrl Name:(NSString*)newName ProductVersion:(Product_Version)version WithCompletion:(void (^)(NSString * errorMsg))handler {
    switch (version) {
        case Product_Version_Unkown:
            handler(@"Failed to get the version of the simple link device");
            return;
        case Product_Version_R1:
            baseUrl = [baseUrl stringByAppendingString:@"/mode_config"];
            break;
        case Product_Version_R2:
            baseUrl = [baseUrl stringByAppendingString:@"/api/1/netapp/set_urn"];
            break;
    }
    
    NSDictionary * params = @{@"__SL_P_S.B" : newName};

Basically, what I'd like to do is set a Unique enough device name to use on starting up the AWS IoT connection with the unique client identifier that both the mobile application knows and the TI board side knows on connection.

An alternative solution I was thinking is passing an additional param via the following code, but I can't seem to find the C side of this code base.  as I searched for references to the following endpoints in the out of box code and didn't fine much..   Maybe this is my lack of understanding that code side.  if you can point me to the C side code for this, that will help as well.

+ (void)addProfileFromUrl:(NSString*)baseUrl SSID:(NSString*)ssid Password:(NSString*)password ProductVersion:(Product_Version)version Security:(SecurityType)securityType WithCompletion:(void (^)(NSString * errorMsg))handler {
    
    switch (version) {
        case Product_Version_Unkown:
            handler(@"Failed to get the version of the simple link device");
            return;
        case Product_Version_R1:
            baseUrl = [baseUrl stringByAppendingString:@"/profiles_add.html"];
            break;
        case Product_Version_R2:
            baseUrl = [baseUrl stringByAppendingString:@"/api/1/wlan/profile_add"];
            break;
    }




  • Hi,

    Could you clarify what you are attempting to do? Are you trying to set the CC3220 name or URL, so that it becomes more unique, or are you trying to make the CC3220 get the device name of your IOS app?

    The add profile code you reference is meant to be a provisioning solution for the CC3220, as in that function should send an HTTP request to the CC3220 and make it use a new Wi-Fi profile to a specified AP. That's probably not related to what you're trying to do.

    There are other HTTP APIs you could use that may accomplish what you're trying to do though. I suggest you take a look at chapter 9 of the NWP programmer's guide for information on those APIs.

    Regards,

    Michael

  • I mostly got around the problem.

    I'm trying to get a unique name for the MQTT IOT Client Identifier that both the TI OOB example AND the TI AWS Iot Plugin know about for the AWS connection "clientIdentifier" field.   Along with, during the mobile provisioning process, the mobile application knows exactly what the client id is on that side.

    So after the provisioning process AND a successful connection to the AP, I know exactly what the clientIdentifier is to connect to AWS.  Also I have to know that exact clientIdentifier is on the mobile app side.  I get it from the provisioning process SSID name know.   So when the TI codebase restarts and connects to the Wifi, I listen on the same "connect" MQTT topic, knowing that it successfully connects.

    I ended up using a custom SSID Name with the mac address.  So when the mobile app connects, I know exactly how to connect on the mobile side, to see if the TI side properly connects to the right AWS Topic and successfully connects.

    You can close it as I found a solution to the problem.

  • Hi,

    Thanks for letting us know that you have worked around your issue.

    Regards,

    Michael