这是官方提供的EasyLink配置。最下面官方注释掉开启HSM网络配置。请问如何配置在4M hsm 下使用easylink进行收发?
if (ui32ModType == EasyLink_Phy_Custom)
{
if(ChipInfo_GetChipType() == CHIP_TYPE_CC2650)
{
memcpy(&EasyLink_cmdPropRadioSetup.setup, &RF_cmdPropRadioDivSetup, sizeof(rfc_CMD_PROP_RADIO_SETUP_t));
}
else
{
memcpy(&EasyLink_cmdPropRadioSetup.divSetup, &RF_cmdPropRadioDivSetup, sizeof(rfc_CMD_PROP_RADIO_DIV_SETUP_t));
}
memcpy(&EasyLink_cmdFs, &RF_cmdFs, sizeof(rfc_CMD_FS_t));
memcpy(&EasyLink_RF_prop, &RF_prop, sizeof(RF_Mode));
memcpy(&EasyLink_cmdPropRxAdv, RF_pCmdPropRxAdv_preDef, sizeof(rfc_CMD_PROP_RX_ADV_t));
memcpy(&EasyLink_cmdPropTx, &RF_cmdPropTx, sizeof(rfc_CMD_PROP_TX_t));
}
else if ( (ui32ModType == EasyLink_Phy_50kbps2gfsk) && (ChipInfo_GetChipType() != CHIP_TYPE_CC2650) )
{
memcpy(&EasyLink_cmdPropRadioSetup.divSetup,
RF_pCmdPropRadioDivSetup_fsk,
sizeof(rfc_CMD_PROP_RADIO_DIV_SETUP_t));
memcpy(&EasyLink_cmdFs, RF_pCmdFs_preDef, sizeof(rfc_CMD_FS_t));
memcpy(&EasyLink_RF_prop, RF_pProp_fsk, sizeof(RF_Mode));
memcpy(&EasyLink_cmdPropRxAdv, RF_pCmdPropRxAdv_preDef, sizeof(rfc_CMD_PROP_RX_ADV_t));
memcpy(&EasyLink_cmdPropTx, RF_pCmdPropTx_preDef, sizeof(rfc_CMD_PROP_TX_t));
}
else if ( (ui32ModType == EasyLink_Phy_625bpsLrm) && (ChipInfo_GetChipType() != CHIP_TYPE_CC2650) )
{
memcpy(&EasyLink_cmdPropRadioSetup.divSetup,
RF_pCmdPropRadioDivSetup_lrm,
sizeof(rfc_CMD_PROP_RADIO_DIV_SETUP_t));
memcpy(&EasyLink_cmdFs, RF_pCmdFs_preDef, sizeof(rfc_CMD_FS_t));
memcpy(&EasyLink_RF_prop, RF_pProp_lrm, sizeof(RF_Mode));
memcpy(&EasyLink_cmdPropRxAdv, RF_pCmdPropRxAdv_preDef, sizeof(rfc_CMD_PROP_RX_ADV_t));
memcpy(&EasyLink_cmdPropTx, RF_pCmdPropTx_preDef, sizeof(rfc_CMD_PROP_TX_t));
}
else if ( (ui32ModType == EasyLink_Phy_2_4_200kbps2gfsk) && (ChipInfo_GetChipType() == CHIP_TYPE_CC2650) )
{
memcpy(&EasyLink_cmdPropRadioSetup.setup,
RF_pCmdPropRadioSetup_2_4G_fsk,
sizeof(rfc_CMD_PROP_RADIO_SETUP_t));
memcpy(&EasyLink_cmdFs, RF_pCmdFs_preDef, sizeof(rfc_CMD_FS_t));
memcpy(&EasyLink_RF_prop, RF_pProp_2_4G_fsk, sizeof(RF_Mode));
memcpy(&EasyLink_cmdPropRxAdv, RF_pCmdPropRxAdv_preDef, sizeof(rfc_CMD_PROP_RX_ADV_t));
memcpy(&EasyLink_cmdPropTx, RF_pCmdPropTx_preDef, sizeof(rfc_CMD_PROP_TX_t));
}
else if ( (ui32ModType == EasyLink_Phy_5kbpsSlLr) && (ChipInfo_GetChipType() != CHIP_TYPE_CC2650) )
{
memcpy(&EasyLink_cmdPropRadioSetup.setup,
RF_pCmdPropRadioDivSetup_sl_lr,
sizeof(rfc_CMD_PROP_RADIO_DIV_SETUP_t));
memcpy(&EasyLink_cmdFs, RF_pCmdFs_preDef, sizeof(rfc_CMD_FS_t));
memcpy(&EasyLink_RF_prop, RF_pProp_sl_lr, sizeof(RF_Mode));
memcpy(&EasyLink_cmdPropRxAdv, RF_pCmdPropRxAdv_preDef, sizeof(rfc_CMD_PROP_RX_ADV_t));
memcpy(&EasyLink_cmdPropTx, RF_pCmdPropTx_preDef, sizeof(rfc_CMD_PROP_TX_t));
}
else
{
if (busyMutex != NULL)
{
Semaphore_post(busyMutex);
}
return EasyLink_Status_Param_Error;
}
if (rfModeMultiClient)
{
EasyLink_RF_prop.rfMode = RF_MODE_MULTIPLE;
}
/* Request access to the radio */
rfHandle = RF_open(&rfObject, &EasyLink_RF_prop,
(RF_RadioSetup*)&EasyLink_cmdPropRadioSetup.setup, &rfParams);
// rfHandle = RF_open(&rfObject, RF_pProp_hsm, (RF_RadioSetup*)RF_pCmdRadioSetup_hsm, &rfParams);
Felix ZF:
你可以参考rfPacketErrorRate示例工程中对HSM的配置方法
另外,请主义,4M的HSM只能在868MHz频段上达到,在433MHz频段不行。