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.

[参考译文] LAUNCHCC3235MOD:tcpecho_CC3235SF_LAUNCHXL_tirtos7_ticlang 连接、因为服务器应处于默认工作站模式(我认为)

Guru**** 2484615 points
Other Parts Discussed in Thread: CC3235SF

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/1273421/launchcc3235mod-tcpecho_cc3235sf_launchxl_tirtos7_ticlang-connect-as-server-should-be-in-default-station-mode-i-thought

器件型号:LAUNCHCC3235MOD
主题中讨论的其他器件:CC3235SF

对于客户端(W10回显客户端)如何与 tcpecho_CC3235SF_LAUNCHXL_tirtos7_ticlang 很明显、我感到困惑。 我看到了 demo 站,但也认为它会保持 SEFAULT 模式(这是在本地网络上的站)。 连接对我来说似乎是错的、但这就是问题吗?

#define TCPPORT 							  (1000)
//...
void Connect(void)
{
    SlWlanSecParams_t   secParams = {0};
    int16_t ret = 0;
    secParams.Key = (signed char*)SECURITY_KEY;
    secParams.KeyLen = strlen(SECURITY_KEY);
    secParams.Type = SECURITY_TYPE;
    Display_printf(display, 0, 0, "Connecting to : %s.\r\n",SSID_NAME);
    ret = sl_WlanConnect((signed char*)SSID_NAME, strlen(SSID_NAME), 0, &secParams, 0);
    if (ret)
    {
        printError("Connection failed", ret);
    }
}

void *TaskCreate(void (*pFun)(void *), char *Name, int Priority, uint32_t StackSize,
        uintptr_t Arg1, uintptr_t Arg2, uintptr_t argReserved)
{
    int32_t             status = 0;
    pthread_attr_t      pAttrs_tcp;
    struct sched_param  priParam;


    /* Start the TCP Worker  */
    pthread_attr_init(&pAttrs_tcp);
    priParam.sched_priority = Priority;
    status = pthread_attr_setschedparam(&pAttrs_tcp, &priParam);
    status |= pthread_attr_setstacksize(&pAttrs_tcp, StackSize);

    status = pthread_create(&tcpworker_thread, &pAttrs_tcp, (void *(*)(void *))pFun, (void *)Arg1);

    if (status < 0) {
        return (NULL);
    }

    return ((void *)!status);
}

void mainThread(void *pvParameters)
{
    int32_t             status = 0;
    pthread_attr_t      pAttrs_spawn;
    struct sched_param  priParam;

    SPI_init();
    Display_init();
    display = Display_open(Display_Type_UART, NULL);
    if (display == NULL) {
        /* Failed to open display driver */
        while(1);
    }

    /* Start the SimpleLink Host */
    pthread_attr_init(&pAttrs_spawn);
    priParam.sched_priority = SPAWN_TASK_PRIORITY;
    status = pthread_attr_setschedparam(&pAttrs_spawn, &priParam);
    status |= pthread_attr_setstacksize(&pAttrs_spawn, TASK_STACK_SIZE);

    status = pthread_create(&spawn_thread, &pAttrs_spawn, sl_Task, NULL);
    if(status)
    {
        printError("Task create failed", status);
    }

	/* Turn NWP on - initialize the device*/
    mode = sl_Start(0, 0, 0);
    if (mode < 0)
    {
        Display_printf(display, 0, 0,"\n\r[line:%d, error code:%d] %s\n\r", __LINE__, mode, DEVICE_ERROR);
    }

    if(mode != ROLE_STA)
    {
        /* Set NWP role as STA */
        mode = sl_WlanSetMode(ROLE_STA);
        if (mode < 0)
        {
            Display_printf(display, 0, 0,"\n\r[line:%d, error code:%d] %s\n\r", __LINE__, mode, WLAN_ERROR);
        }

        /* For changes to take affect, we restart the NWP */
        status = sl_Stop(SL_STOP_TIMEOUT);
        if (status < 0)
        {
            Display_printf(display, 0, 0,"\n\r[line:%d, error code:%d] %s\n\r", __LINE__, status, DEVICE_ERROR);
        }

        mode = sl_Start(0, 0, 0);
        if (mode < 0)
        {
            Display_printf(display, 0, 0,"\n\r[line:%d, error code:%d] %s\n\r", __LINE__, mode, DEVICE_ERROR);
        }
    }

    if(mode != ROLE_STA)
    {
        printError("Failed to configure device to it's default state", mode);
    }

    Connect();
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    如何将其设置为工作站模式下的服务器、而我认为这是工作默认值? 一旦我停止调试、器件就可以在本地网络上再次 Ping。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    使它能够正常工作(我的客户端中的服务器预期出现了错误。 现在、我想知道如何仅使用默认配置文件(或最高优先级)?

    #define SLNET_IF_WIFI_NAME                    "trog3235" //"CC32xx"
    
    #define SSID_NAME                             "WR000150"  //my local ssid      /* AP SSID */
    #define SECURITY_TYPE                         SL_WLAN_SEC_TYPE_WPA_WPA2 /* Security type could be SL_WLAN_SEC_TYPE_OPEN */
    #define SECURITY_KEY                          "xxxxxxxxxxxxxxxxxxx" // "12345678" password of the secured AP */
    

    我唯一奇怪的是、路由器 在2.4GHz SSI=WR0001上具有相同的地址、而在5GHz WR00150 tcpEcho 上运行时、它们具有相同的地址192.168.1.94。MAC 相同。   

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Malcolm:

    我已将此报告分配给了我们的一位软件工程师、请允许工作至周一、我们会回复您的问题。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Malcolm:

    请允许明天回复,我忘了他们今天在观察 Yom Kippur。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Malcolm:

    不确定原始问题是什么、因为它应该会进入站点模式并进行连接。 我很高兴你让它工作.

    该示例使用了与 AP 的显式连接、但如果需要、可将其更改为配置文件。 在 sl_Start()之后,您可以删除 Connect(),它应该会自动连接。 我们随 SDK 提供的示例是 netif 模块的一部分、可以在 SDK 中的两个示例 connection_manager 和 mqtt_client 上找到该模块。

    您还可以在 /docs/ns/NS_Users_Guide.html。

    此致、

    什洛米