中级
20 分钟

使用WIRL-PRO2和MK64FN1M0VDC12将Wirepas Mesh无线连接堆栈集成到您的应用中

Wirepas Click 立刻行动!

Wirepas Click with Clicker 2 for Kinetis

已发布 6月 28, 2024

点击板

Wirepas Click

开发板

Clicker 2 for Kinetis

编译器

NECTO Studio

微控制器单元

MK64FN1M0VDC12

您的网关可以创建坚固的、自愈的和节能的网状网络,适用于智能照明、资产追踪等应用!

A

A

硬件概览

它是如何工作的?

Wirepas Click 基于 Würth Elektronik 的 WIRL-PRO2 Thetis-I,这是一款带有 Wirepas Mesh 协议的无线电模块。该模块旨在集成到基于 Wirepas 的路由网络中,用于设备或节点之间的无线通信。该模块在全球可用的免许可 2.4 GHz 频段内安全可靠地传输数据,具有认证和加密机制。WIRL-PRO2 Thetis-I 模块具有与 nano-SIM 卡相当的小尺寸(8 mm x 12 mm),包括板载 PCB 天线,使其非常适合小型设计。该模块工作在 2402 到 2480MHz 的频率范围内,数据速率高达 1Mbps。它基于 Nordic 

Semiconductor 的 32 位 ARM Cortex-M4 微控制器 nRF52840,配有 1MB 闪存和 256KB RAM。它具有印刷天线和智能天线配置(2 合 1 模块),允许高达 +6dBm 的发射功率和 -92dBm 的灵敏度。通过连接到板载 N.FL 连接器的外部天线,连接性能可以更好。由于其非常低的功耗,Wirepas Click 可以作为信标使用。为此,它配备了一个备用电池。此外,还有两个用户可配置的指示 LED,LED1 和 LED2(蓝色和绿色)。此外,Wirepas Click 还配备了一个未焊接的调试头,用于与 Wirepas 微控制器进行直接

通信。Wirepas Click 使用标准的 2 线 UART 接口与主 MCU 通信,支持 115200bps 的比特率。您可以通过 RST 引脚重置设备。DIN 引脚用于观察数据流,当处于低电平逻辑状态时,它是指向主 MCU 的数据指示。此 Click board™ 只能在 3.3V 逻辑电压水平下运行。使用具有不同逻辑电平的 MCU 之前,板必须进行适当的逻辑电压水平转换。此外,这款 Click board™ 配备了包含易于使用的功能和示例代码的库,可用于进一步开发。

Wirepas Click hardware overview image

功能概述

开发板

Clicker 2 for Kinetis 是一款紧凑型入门开发板,它将 Click 板™的灵活性带给您喜爱的微控制器,使其成为实现您想法的完美入门套件。它配备了一款板载 32 位 ARM Cortex-M4F 微控制器,NXP 半导体公司的 MK64FN1M0VDC12,两个 mikroBUS™ 插槽用于 Click 板™连接,一个 USB 连接器,LED 指示灯,按钮,一个 JTAG 程序员连接器以及两个 26 针头用于与外部电子设备的接口。其紧凑的设计和清晰、易识别的丝网标记让您能够迅速构建具有独特功能和特性

的小工具。Clicker 2 for Kinetis 开发套件的每个部分 都包含了使同一板块运行最高效的必要组件。除了可以选择 Clicker 2 for Kinetis 的编程方式,使用 USB HID mikroBootloader 或外部 mikroProg 连接器进行 Kinetis 编程外,Clicker 2 板还包括一个干净且调节过的开发套件电源供应模块。它提供了两种供电方式;通过 USB Micro-B 电缆,其中板载电压调节器为板上每个组件提供适当的电压水平,或使用锂聚合物 电池通过板载电池连接器供电。所有 mikroBUS™ 本

身支持的通信方法都在这块板上,包括已经建立良好的 mikroBUS™ 插槽、重置按钮和几个用户可配置的按钮及 LED 指示灯。Clicker 2 for Kinetis 是 Mikroe 生态系统的一个组成部分,允许您在几分钟内创建新的应用程序。它由 Mikroe 软件工具原生支持,得益于大量不同的 Click 板™(超过一千块板),其数量每天都在增长,它涵盖了原型制作的许多方面。

Clicker 2 for Kinetis dimensions image

微控制器概述 

MCU卡片 / MCU

default

建筑

ARM Cortex-M4

MCU 内存 (KB)

1024

硅供应商

NXP

引脚数

121

RAM (字节)

262144

使用的MCU引脚

mikroBUS™映射器

NC
NC
AN
Reset
PB11
RST
ID COMM
PC4
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
Data Indication
PB13
INT
UART TX
PD3
TX
UART RX
PD2
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

Wirepas Click Schematic schematic

一步一步来

项目组装

Clicker 2 for PIC32MZ front image hardware assembly

从选择您的开发板和Click板™开始。以Clicker 2 for Kinetis作为您的开发板开始。

Clicker 2 for PIC32MZ front image hardware assembly
GNSS2 Click front image hardware assembly
Prog-cut hardware assembly
Board mapper by product7 hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
Flip&Click PIC32MZ MCU step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

软件支持

库描述

该库包含 Wirepas Click 驱动程序的 API。

关键功能:

  • wirepas_send_command - Wirepas 发送命令功能。

  • wirepas_write_csap_attribute - Wirepas 写入 CSAP 属性功能。

  • wirepas_send_data - Wirepas 发送数据功能。

开源

代码示例

完整的应用程序代码和一个现成的项目可以通过NECTO Studio包管理器直接安装到NECTO Studio 应用程序代码也可以在MIKROE的GitHub账户中找到。

/*!
 * @file main.c
 * @brief Wirepas Click Example.
 *
 * # Description
 * This example demonstrates the use of Wirepas Click board by processing
 * the incoming data and displaying them on the USB UART in sink mode, and sending data to 
 * the sinks in router mode.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and performs the Click default configuration, setting device mode, node,
 * net and channel addresses, and starting stack.
 *
 * ## Application Task
 * Router mode - Sending data to the sinks at the same network.
 * Sink mode - Reads and processes all incoming data and displays them on the USB UART.
 *
 * ## Additional Function
 * - err_t wirepas_wait_response ( wirepas_t *ctx, uint8_t primitive_id )
 * - err_t wirepas_parse_frame ( wirepas_t *ctx, uint8_t primitive_id )
 * - err_t wirepas_poll_indication ( wirepas_t *ctx )
 *
 * @note
 * For the best experience use two Clicks in sink mode and one in router.
 *
 * @author Stefan Ilic
 *
 */

#include "board.h"
#include "log.h"
#include "wirepas.h"

#define PROCESS_BUFFER_SIZE 300
#define TX_DATA             "Wirepas Click"

#define MULTI_SINK_MODE     // Comment out this macro to place device into single sink mode.

/**
* @brief Wirepas node addresses.
 * @details Specified setting for node addresses of Wirepas Click driver.
 */
#define ROUTER_NODE_ADDRESS         0x01
#define SINK_1_NODE_ADDRESS         0x02
#define SINK_2_NODE_ADDRESS         0x03
#define NET_ADDRESS                 0x01
#define CHANNEL_ADDRESS             0x01

#define NODE_ADDRESS                ROUTER_NODE_ADDRESS    /* Change the value of this macro to change 
                                                              node address, each node should have a unique address */

static wirepas_t wirepas;
static log_t logger;
uint8_t frame_id = 0;
uint8_t stack_auto_start = 1;
uint8_t pdu_capacity = 0x10;
wirepas_sink_data sink_1;
wirepas_sink_data sink_2;

/**
 * @brief Wirepas wait response function.
 * @details This function is used to get response from the device. 
 * @param[in] ctx : Click context object.
 * See #wirepas_t object definition for detailed explanation.
 * @param[in] primitive_id : Expected Primitive ID.
 * @return @li @c >=0 - Success,
 *         @li @c  <0 - Error.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
err_t wirepas_wait_response ( wirepas_t *ctx, uint8_t primitive_id );

/**
 * @brief Wirepas parse frame function.
 * @details This function is used to parse frame response from the device. 
 * @param[in] ctx : Click context object.
 * See #wirepas_t object definition for detailed explanation.
 * @param[in] primitive_id : Expected Primitive ID.
 * @return @li @c >=0 - Success,
 *         @li @c  <0 - Error.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
err_t wirepas_parse_frame ( wirepas_t *ctx, uint8_t primitive_id );

/**
 * @brief Wirepas send poll indication function function.
 * @details This function is used to send poll indication, 
 * and get response from the device. 
 * @param[in] ctx : Click context object.
 * See #wirepas_t object definition for detailed explanation.
 * @param[in] primitive_id : Expected Primitive ID.
 * @return @li @c >=0 - Success,
 *         @li @c  <0 - Error.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
err_t wirepas_poll_indication ( wirepas_t *ctx );

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    wirepas_cfg_t wirepas_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    wirepas_cfg_setup( &wirepas_cfg );
    WIREPAS_MAP_MIKROBUS( wirepas_cfg, MIKROBUS_1 );
    if ( UART_ERROR == wirepas_init( &wirepas, &wirepas_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    wirepas_default_cfg ( &wirepas );
   
    wirepas.tx_frame_id = 0;
    do
    {
        log_printf( &logger, " Wirepas stack stop request:" );
        wirepas_send_command( &wirepas, WIREPAS_MSAP_STACK_STOP_REQUEST, 0, NULL );
    }
    while ( WIREPAS_OK != wirepas_wait_response ( &wirepas, WIREPAS_MSAP_STACK_STOP_CONFIRM ) );
    Delay_ms ( 1000 );
    
    do
    {
        log_printf( &logger, " Wirepas factory reset request:" );
        wirepas_send_command( &wirepas, WIREPAS_CSAP_FACTORY_RESET_REQUEST,
                              strlen( WIREPAS_FACTORY_RESET_CODE ), WIREPAS_FACTORY_RESET_CODE );
    }
    while ( WIREPAS_OK != wirepas_wait_response ( &wirepas, WIREPAS_CSAP_FACTORY_RESET_CONFIRM ) );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    do
    {
        log_printf( &logger, " Set node address:" );
        wirepas_set_node_address( &wirepas, NODE_ADDRESS );
    }
    while ( WIREPAS_OK != wirepas_wait_response ( &wirepas, WIREPAS_CSAP_ATTRIBUTE_WRITE_CONFIRM ) );
    Delay_ms ( 1000 );
    
    do
    {
        log_printf( &logger, " Set net address:" );
        wirepas_set_net_address( &wirepas, NET_ADDRESS );
    }
    while ( WIREPAS_OK != wirepas_wait_response ( &wirepas, WIREPAS_CSAP_ATTRIBUTE_WRITE_CONFIRM ) );
    Delay_ms ( 1000 );
    
    uint8_t channel_net = CHANNEL_ADDRESS;
    do
    {
        log_printf( &logger, " Set channel address:" );
        wirepas_write_csap_attribute( &wirepas, WIREPAS_CSAP_ATTRIBUTE_NETWORK_CHANNEL, 1, &channel_net );
    }
    while ( WIREPAS_OK != wirepas_wait_response ( &wirepas, WIREPAS_CSAP_ATTRIBUTE_WRITE_CONFIRM ) );
    Delay_ms ( 1000 );


    uint8_t role;
#if ( ROUTER_NODE_ADDRESS == NODE_ADDRESS )
    role = WIREPAS_ROUTER_NODE_MODE;
#else
    role = WIREPAS_SINK_NODE_MODE;
#endif
    do
    {
        log_printf( &logger, " Set role:" );
        wirepas_write_csap_attribute( &wirepas, WIREPAS_CSAP_ATTRIBUTE_NODE_ROLE, 1, &role );
    }
    while ( WIREPAS_OK != wirepas_wait_response ( &wirepas, WIREPAS_CSAP_ATTRIBUTE_WRITE_CONFIRM ) );
    Delay_1sec( );
    
    do
    {
        log_printf( &logger, " Wirepas Stack start request:" ); 
        wirepas_send_command( &wirepas, WIREPAS_MSAP_STACK_START_REQUEST, 1, &stack_auto_start );
    }
    while ( WIREPAS_OK != wirepas_wait_response ( &wirepas, WIREPAS_MSAP_STACK_START_CONFIRM ) );
    Delay_1sec( );
        
#if ( ROUTER_NODE_ADDRESS == NODE_ADDRESS )

    sink_1.pduid = 0x00;
    sink_1.source_endpoint = 0x01;
    sink_1.destination_addr = SINK_1_NODE_ADDRESS;
    sink_1.destination_endpoint = 0x01;
    #if defined MULTI_SINK_MODE
        sink_2.pduid = 0x00;
        sink_2.source_endpoint = 0x01;
        sink_2.destination_addr = SINK_2_NODE_ADDRESS;
        sink_2.destination_endpoint = 0x01;
    #endif
#endif
    Delay_ms ( 100 );
    
    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    wirepas_poll_indication ( &wirepas );
#if ( ROUTER_NODE_ADDRESS == NODE_ADDRESS )
    if ( wirepas_get_din_state ( &wirepas ) && ( pdu_capacity > 0 ) )
    {
        log_printf( &logger, " Sending data to the first Sink node: \n" );
        wirepas_send_data ( &wirepas,  sink_1, 0x01, strlen( TX_DATA ), TX_DATA );
        wirepas_wait_response ( &wirepas, WIREPAS_DSAP_DATA_TX_CONFIRM );
        Delay_ms ( 1000 );
        
        #if defined MULTI_SINK_MODE
            log_printf( &logger, " Sending data to the second Sink node: \n" );
            wirepas_send_data ( &wirepas,  sink_2, 0x01, strlen( TX_DATA ), TX_DATA );
            wirepas_wait_response ( &wirepas, WIREPAS_DSAP_DATA_TX_CONFIRM );
            Delay_ms ( 1000 );
        #endif
    }
#endif
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

err_t wirepas_wait_response ( wirepas_t *ctx, uint8_t primitive_id )
{
    for ( uint8_t cnt = 0; cnt < 5; cnt++ )
    {
        if ( WIREPAS_OK == wirepas_parse_frame ( ctx, primitive_id ) )
        {
            return WIREPAS_OK;
        }
    }
    return WIREPAS_ERROR;
}

err_t wirepas_parse_frame ( wirepas_t *ctx, uint8_t primitive_id )
{
    err_t error_flag = wirepas_read_frame ( ctx, &ctx->frame );
    if ( WIREPAS_OK == error_flag )
    {
        if ( ( primitive_id != ctx->frame.primitive_id ) && ( 0 != primitive_id ) )
        {
            error_flag |= WIREPAS_ERROR;
        }
        switch ( ctx->frame.primitive_id )
        {
            case WIREPAS_MSAP_STACK_STOP_CONFIRM:
            case WIREPAS_MSAP_STACK_START_CONFIRM:
            case WIREPAS_CSAP_FACTORY_RESET_CONFIRM:
            case WIREPAS_CSAP_ATTRIBUTE_WRITE_CONFIRM:
            {
                if ( 0 == ctx->frame.payload[ 0 ] )
                {
                    log_printf( &logger, " OK\r\n" );
                }
                else 
                {
                    log_printf( &logger, " ERROR[%u]\r\n", ( uint16_t ) ctx->frame.payload[ 0 ] );
                    error_flag |= WIREPAS_ERROR;
                }
                break;
            }
            case WIREPAS_DSAP_DATA_TX_CONFIRM:
            {
                pdu_capacity = ctx->frame.payload[ 3 ];
                if ( 0 == ctx->frame.payload[ 2 ] )
                {
                    log_printf( &logger, " TX request with PDU_ID[%u] is placed\r\n", 
                                ( ( ( uint16_t ) ctx->frame.payload[ 1 ] << 8 ) | ctx->frame.payload[ 0 ] ) );
                    sink_1.pduid += 1;
                    if ( sink_1.pduid >= 16 )
                    {
                        sink_1.pduid = 0;
                    }
                #if defined MULTI_SINK_MODE
                    sink_2.pduid += 1;
                    if ( sink_2.pduid >= 16 )
                    {
                        sink_2.pduid = 0;
                    }
                #endif
                }
                else 
                {
                    log_printf( &logger, " ERROR[%u] on TX request with PDU_ID[%u]\r\n", ( uint16_t ) ctx->frame.payload[ 2 ],
                                ( ( ( uint16_t ) ctx->frame.payload[ 1 ] << 8 ) | ctx->frame.payload[ 0 ] ) );
                    error_flag |= WIREPAS_ERROR;
                }
                break;
            }
            case WIREPAS_MSAP_INDICATION_POLL_CONFIRM:
            {
                if ( 1 == ctx->frame.payload[ 0 ] )
                {
                    log_printf( &logger, " There are pending indications\r\n" );
                }
                else
                {
                    log_printf( &logger, " No pending indications on poll request\r\n" );
                }
                break;
            }
            case WIREPAS_DSAP_DATA_TX_INDICATION:
            {
                wirepas_send_ack ( ctx, WIREPAS_DSAP_DATA_TX_RESPONSE, ctx->frame.frame_id, ctx->frame.payload[ 0 ] );
                log_printf( &logger, " TX data with PDU_ID[%u] is sent to dest address: %lu\r\n", 
                            ( ( ( uint16_t ) ctx->frame.payload[ 2 ] << 8 ) | ctx->frame.payload[ 1 ] ),
                            ( ( ( uint32_t ) ctx->frame.payload[ 7 ] << 24 ) | ( ( uint32_t ) ctx->frame.payload[ 6 ] << 16 ) |
                              ( ( uint16_t ) ctx->frame.payload[ 5 ] << 8 ) | ctx->frame.payload[ 4 ] ) );
                pdu_capacity++;
                break;
            }
            case WIREPAS_DSAP_DATA_RX_INDICATION:
            {
                wirepas_send_ack ( ctx, WIREPAS_DSAP_DATA_RX_RESPONSE, ctx->frame.frame_id, ctx->frame.payload[ 0 ] );
                log_printf( &logger, " RX data is received from src address: %lu\r\n", 
                            ( ( ( uint32_t ) ctx->frame.payload[ 4 ] << 24 ) | ( ( uint32_t ) ctx->frame.payload[ 3 ] << 16 ) |
                              ( ( uint16_t ) ctx->frame.payload[ 2 ] << 8 ) | ctx->frame.payload[ 1 ] ) );
                log_printf( &logger, " RX data: " );
                for ( uint8_t cnt = 0; cnt < ctx->frame.payload[ 16 ]; cnt++ )
                {
                    log_printf( &logger, "%c", ctx->frame.payload[ 17 + cnt ] );
                }
                log_printf( &logger, "\r\n---------------------------\r\n" );
                break;
            }
            case WIREPAS_MSAP_STACK_STATE_INDICATION:
            {
                wirepas_send_ack ( ctx, WIREPAS_MSAP_STACK_STATE_RESPONSE, ctx->frame.frame_id, ctx->frame.payload[ 0 ] );
                log_printf( &logger, " Stack state indication: 0x%.2X\r\n", ctx->frame.payload[ 1 ] );
                break;
            }
            case WIREPAS_MSAP_APP_CONFIG_DATA_RX_IND:
            {
                wirepas_send_ack ( ctx, WIREPAS_MSAP_APP_CONFIG_DATA_RX_RESP, ctx->frame.frame_id, ctx->frame.payload[ 0 ] );
                log_printf( &logger, " MSAP app config data rx indication\r\n" );
                break;
            }
            case WIREPAS_MSAP_SCAN_NBORS_INDICATION:
            {
                wirepas_send_ack ( ctx, WIREPAS_MSAP_SCAN_NBORS_RESPONSE, ctx->frame.frame_id, ctx->frame.payload[ 0 ] );
                if ( ctx->frame.payload[ 1 ] )
                {
                    log_printf( &logger, " Neighbors scan is done and ready\r\n" );
                }
                else
                {
                    log_printf( &logger, " Neighbors scan is NOT done and ready\r\n" );
                }
                break;
            }
            default:
            {
                log_printf( &logger, " Frame with unknown primitive ID [0x%.2X] is received\r\n", 
                            ( uint16_t ) ctx->frame.primitive_id );
                log_printf( &logger, " Frame ID: %u\r\n", ( uint16_t ) ctx->frame.primitive_id );
                log_printf( &logger, " Payload len: %u\r\n", ( uint16_t ) ctx->frame.payload_len );
                log_printf( &logger, " Payload: ", ( uint16_t ) ctx->frame.payload_len );
                for ( uint8_t cnt = 0; cnt < ctx->frame.payload_len; cnt++ )
                {
                    log_printf( &logger, "%.2X ", ctx->frame.payload[ cnt ] );
                }
                log_printf( &logger, "\r\n" );
                error_flag |= WIREPAS_ERROR;
                break;
            }
        }
    }
    return error_flag;
}

err_t wirepas_poll_indication ( wirepas_t *ctx )
{
    err_t error_flag = WIREPAS_OK;
    uint32_t timeout_cnt = 0;
    while ( wirepas_get_din_state ( ctx ) )
    {
        if ( timeout_cnt++ > 2000 )
        {
            log_printf( &logger, " No pending indications on DIN pin\r\n" );
            break;
        }
        Delay_1ms ( );
    }
    timeout_cnt = 0;

    wirepas_send_command( ctx, WIREPAS_MSAP_INDICATION_POLL_REQUEST, 0, NULL );
    error_flag |= wirepas_wait_response ( ctx, WIREPAS_MSAP_INDICATION_POLL_CONFIRM );
    if ( WIREPAS_OK != error_flag )
    {
        return WIREPAS_ERROR;
    }
    while ( ( WIREPAS_OK == error_flag ) && ( ctx->frame.payload[ 0 ] == 0x01 ) )
    {
        error_flag |= wirepas_parse_frame ( ctx, 0 );
        if ( WIREPAS_OK == error_flag )
        {
            switch ( ctx->frame.primitive_id )
            {
                case WIREPAS_DSAP_DATA_TX_INDICATION:
                case WIREPAS_DSAP_DATA_RX_INDICATION:
                case WIREPAS_MSAP_STACK_STATE_INDICATION:
                case WIREPAS_MSAP_APP_CONFIG_DATA_RX_IND:
                case WIREPAS_MSAP_SCAN_NBORS_INDICATION:
                {
                    if ( ( ctx->frame.payload[ 0 ] == 0x00 ) )
                    {
                        while ( !wirepas_get_din_state ( ctx ) )
                        {
                            if ( timeout_cnt++ > 200 )
                            {
                                log_printf( &logger, " ERROR no IRQ clear\r\n" );
                                error_flag |= WIREPAS_ERROR;
                                break;
                            }
                            Delay_1ms ( );
                        }
                    }
                    break;
                }
                default:
                {
                    break;
                }
            }
        }
        else
        {
            log_printf( &logger, " ERROR on indication frame parse\r\n" );
        }
        if ( WIREPAS_OK != error_flag )
        {
            do
            {
                log_printf( &logger, " Wirepas stack stop request:" );
                wirepas_send_command( &wirepas, WIREPAS_MSAP_STACK_STOP_REQUEST, 0, NULL );
            }
            while ( WIREPAS_OK != wirepas_wait_response ( &wirepas, WIREPAS_MSAP_STACK_STOP_CONFIRM ) );
            Delay_1sec( );

            do
            {
                log_printf( &logger, " Wirepas Stack start request:" ); 
                wirepas_send_command( &wirepas, WIREPAS_MSAP_STACK_START_REQUEST, 1, &stack_auto_start );
            }
            while ( WIREPAS_OK != wirepas_wait_response ( &wirepas, WIREPAS_MSAP_STACK_START_CONFIRM ) );
            Delay_1sec( );
        }
    }
    return error_flag;
}

// ------------------------------------------------------------------------ END

额外支持

资源

喜欢这个项目吗?

'购买此套件' 按钮会直接带您进入购物车,您可以在购物车中轻松添加或移除产品。