CH59x CH58x BLE芯片运行过程修改mac地址

/**
 * @brief   Setup the device's address type.  If ADDRTYPE_PRIVATE_RESOLVE is selected,
 *          the address will change periodically.
 *
 * @param   addrType - @ref GAP_ADDR_TYPE_DEFINES
 * @param   pStaticAddr - Only used with ADDRTYPE_STATIC or ADDRTYPE_PRIVATE_NONRESOLVE type
 *                   NULL to auto generate otherwise the application can specify the address value
 *
 * @return  SUCCESS: address type updated,<BR>
 *          bleNotReady: Can't be called until GAP_DeviceInit() is called
 *                   and the init process is completed
 *          bleIncorrectMode: can't change with an active connection,or INVALIDPARAMETER
 *          If return value isn't SUCCESS, the address type remains the same as before this call.
 */
extern bStatus_t GAP_ConfigDeviceAddr( uint8_t addrType, uint8_t *pStaticAddr );

举例

//关掉广播以后
if(GAP_ConfigDeviceAddr(ADDRTYPE_STATIC, Addr) == SUCCESS)
{
PRINT("Mac changed..\n");
}

posted @ 2026-10-08 10:21  debugdabiaoge  阅读(6)  评论(0)    收藏  举报