• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ osal_memset函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中osal_memset函数的典型用法代码示例。如果您正苦于以下问题:C++ osal_memset函数的具体用法?C++ osal_memset怎么用?C++ osal_memset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osal_memset函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: zllSampleLight_SceneStoreCB

/*********************************************************************
 * @fn      zllSampleLight_SceneStoreCB
 *
 * @brief   Callback from the ZCL General Cluster Library when
 *          it received a Scene Store Request Command for
 *          this application.
 *          Stores current attributes in the scene's extension fields.
 *          Extension field sets =
 *          {{Cluster ID 1, length 1, {extension field set 1}}, {{Cluster ID 2,
 *            length 2, {extension field set 2}}, ...}
 *
 * @param   pReq - pointer to a request holding scene data
 *
 * @return  TRUE if extField is filled out, FALSE if not filled
 *          and there is no need to save the scene
 */
static uint8 zllSampleLight_SceneStoreCB( zclSceneReq_t *pReq )
{
  uint8 *pExt;

  pReq->scene->extLen = SAMPLELIGHT_SCENE_EXT_FIELD_SIZE;
  pExt = pReq->scene->extField;

  // Build an extension field for On/Off cluster
  *pExt++ = LO_UINT16( ZCL_CLUSTER_ID_GEN_ON_OFF );
  *pExt++ = HI_UINT16( ZCL_CLUSTER_ID_GEN_ON_OFF );
  *pExt++ = sizeof(zllSampleLight_OnOff); // length

  // Store the value of onOff attribute
  *pExt++ = zllSampleLight_OnOff;

#ifdef ZCL_LEVEL_CTRL
  // Build an extension field for Level Control cluster
  *pExt++ = LO_UINT16( ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL );
  *pExt++ = HI_UINT16( ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL );
  *pExt++ = sizeof(zclLevel_CurrentLevel); // length

  // Store the value of currentLevel attribute
  *pExt++ = zclLevel_CurrentLevel;
#endif //ZCL_LEVEL_CTRL

#ifdef ZCL_COLOR_CTRL
  // Build an extension field for Color Control cluster
  *pExt++ = LO_UINT16( ZCL_CLUSTER_ID_LIGHTING_COLOR_CONTROL );
  *pExt++ = HI_UINT16( ZCL_CLUSTER_ID_LIGHTING_COLOR_CONTROL );
  *pExt++ = COLOR_SCN_X_Y_ATTRS_SIZE + COLOR_SCN_HUE_SAT_ATTRS_SIZE + COLOR_SCN_LOOP_ATTRS_SIZE; // length

  // Restored color mode is determined by whether stored currentX, currentY values are 0.
  if ( zclColor_ColorMode == COLOR_MODE_CURRENT_X_Y )
  {
    *pExt++ = LO_UINT16( zclColor_CurrentX );
    *pExt++ = HI_UINT16( zclColor_CurrentX );
    *pExt++ = LO_UINT16( zclColor_CurrentY );
    *pExt++ = HI_UINT16( zclColor_CurrentY );
    pExt += COLOR_SCN_HUE_SAT_ATTRS_SIZE + COLOR_SCN_LOOP_ATTRS_SIZE; // ignore other parameters
  }
  else
  {
    // nullify currentX and currentY to mark hue/sat color mode
    osal_memset( pExt, 0x00, COLOR_SCN_X_Y_ATTRS_SIZE );
    pExt += COLOR_SCN_X_Y_ATTRS_SIZE;
    *pExt++ = LO_UINT16( zclColor_EnhancedCurrentHue );
    *pExt++ = HI_UINT16( zclColor_EnhancedCurrentHue );
    *pExt++ = zclColor_CurrentSaturation;
    *pExt++ = zclColor_ColorLoopActive;
    *pExt++ = zclColor_ColorLoopDirection;
    *pExt++ = LO_UINT16( zclColor_ColorLoopTime );
    *pExt++ = HI_UINT16( zclColor_ColorLoopTime );
  }
#endif //ZCL_COLOR_CTRL

  // Add more clusters here

  return ( TRUE );
}
开发者ID:saiwaiyanyu,项目名称:Zlight,代码行数:75,代码来源:zll_samplelight.c


示例2: MT_UtilBindAddEntry

/***************************************************************************************************
 * @fn      MT_UtilBindAddEntry
 *
 * @brief   Add Binding Entry into Local Table.
 *
 * @param   pBuf - pointer to the received buffer
 *
 * @return  void
 ***************************************************************************************************/
static void MT_UtilBindAddEntry(uint8 *pBuf)
{
  uint8 srcEp;
  zAddrType_t dstAddr;
  uint8 dstEp;
  uint8 numClusterIds;
  uint16 *clusterIds;
  uint8 buf[sizeof(BindingEntry_t)];
  uint8 cmdId = pBuf[MT_RPC_POS_CMD1];
  pBuf += MT_RPC_FRAME_HDR_SZ;

  // Initialize the return buffer
  osal_memset( buf, 0xFF, sizeof(BindingEntry_t) );
  buf[2] = 0xFE;    // set the default value of INVALID_NODE_ADDR
  buf[3] = 0xFF;    // set the default value of INVALID_NODE_ADDR

  srcEp = *pBuf++;

  // Destination Address mode
  dstAddr.addrMode = *pBuf++;

  // Destination Address
  if ( dstAddr.addrMode == Addr64Bit )
  {
    uint8 *ptr; // Use this additional pointer because *pBuf is incremented later for both cases

    ptr = pBuf;
    osal_cpyExtAddr( dstAddr.addr.extAddr, ptr );
  }
  else
  {
    dstAddr.addr.shortAddr = BUILD_UINT16( pBuf[0], pBuf[1] );
  }
  // The short address occupies LSB two bytes
  pBuf += Z_EXTADDR_LEN;

  // DstEPInt
  dstEp = *pBuf++;

  numClusterIds = *pBuf++;

  if ( numClusterIds > 0 )
  {
    // copy list of clusters
    clusterIds = (uint16 *)osal_mem_alloc( numClusterIds * sizeof(uint16) );
    osal_memcpy( clusterIds, pBuf, numClusterIds * sizeof(uint16));

    if ( clusterIds != NULL )
    {
      // The response to MT interface has to be pack into buf
      packBindEntry_t( buf, bindAddEntry( srcEp, &dstAddr, dstEp, numClusterIds, clusterIds ));

      osal_mem_free( clusterIds );
    }
  }

  MT_BuildAndSendZToolResponse( ( (uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_UTIL ),
                                cmdId, sizeof(BindingEntry_t), buf );
}
开发者ID:saiwaiyanyu,项目名称:Zlight,代码行数:68,代码来源:MT_UTIL.c


示例3: Wechat_Init

/*********************************************************************
 * @fn      Wechat_Init
 *
 * @brief   Initialization function for the BLE wechat App Task.
 *          This is called during initialization and should contain
 *          any application specific initialization (ie. hardware
 *          initialization/setup, table initialization, power up
 *          notificaiton ... ).
 *
 * @param   none
 *
 * @return  none
 */
uint8 Wechat_Init( void )
{
 	uint8 stat = SUCCESS;
  osal_memset( wechatStoreAuth, 0, (sizeof(attHandleValueInd_t) * WECHAT_AUTH_STORE_MAX) );
  Wechat_state_reset();
	stat = Wechat_get_md5();
	return stat;
}
开发者ID:billy-wang,项目名称:IOT,代码行数:21,代码来源:wechatapp.c


示例4: timeAppDiscStart

/*********************************************************************
 * @fn      timeAppDiscStart()
 *
 * @brief   Start service discovery. 
 *
 *
 * @return  New discovery state.
 */
uint8 timeAppDiscStart( void )
{
  // Clear handle cache
  osal_memset( timeAppHdlCache, 0, sizeof(timeAppHdlCache) );
  
  // Start discovery with first service
  return timeAppDiscGattMsg( DISC_CURR_TIME_START, NULL );
}
开发者ID:JensenSung,项目名称:shred444,代码行数:16,代码来源:timeapp_discovery.c


示例5: glucoseDiscStart

/*********************************************************************
 * @fn      glucoseDiscStart()
 *
 * @brief   Start service discovery. 
 *
 *
 * @return  New discovery state.
 */
uint8 glucoseDiscStart( void )
{
  // Clear handle cache
  osal_memset( glucoseHdlCache, 0, sizeof(glucoseHdlCache) );
  
  // Start discovery with first service
  return glucoseDiscGattMsg( DISC_GLUCOSE_START, NULL );
}
开发者ID:AubrCool,项目名称:BLE,代码行数:16,代码来源:glucose_discovery.c


示例6: softCmdDiscStart

/*********************************************************************
 * @fn      softCmdDiscStart()
 *
 * @brief   Start service discovery. 
 *
 *
 * @return  New discovery state.
 */
static uint8 softCmdDiscStart( void )
{
  // Clear handle cache
  osal_memset( softCmdHdlCache, 0, sizeof(softCmdHdlCache) );
  
  // Start discovery with first service
  return softCmdDiscGenCtrl( DISC_GEN_CTRL_START, NULL );
}
开发者ID:JensenSung,项目名称:shred444,代码行数:16,代码来源:softcmd.c


示例7: osal_mem_free

/*********************************************************************
 * @fn      osal_mem_free
 *
 * @brief   Implementation of the de-allocator functionality.
 *
 * @param   ptr - pointer to the memory to free.
 *
 * @return  void
 */
void osal_mem_free( void *ptr )
{
  osalMemHdr_t *currHdr;
  halIntState_t intState;

#if ( OSALMEM_GUARD )
  // Try to protect against premature use by HAL / OSAL.
  if ( ready != OSALMEM_READY )
  {
    osal_mem_init();
  }
#endif

  HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.

  OSALMEM_ASSERT( ptr );

  currHdr = (osalMemHdr_t *)ptr - 1;

  // Has this block already been freed?
  OSALMEM_ASSERT( *currHdr & OSALMEM_IN_USE );

  *currHdr &= ~OSALMEM_IN_USE;

#if ( OSALMEM_PROFILER )
  {
    uint16 size = *currHdr;
    byte idx;

    for ( idx = 0; idx < OSALMEM_PROMAX; idx++ )
    {
      if ( size <= proCnt[idx] )
      {
        break;
      }
    }

    proCur[idx]--;
  }
#endif

#if ( OSALMEM_METRICS )
  memAlo -= *currHdr;
  blkFree++;
#endif

  if ( ff1 > currHdr )
  {
    ff1 = currHdr;
  }

#if ( OSALMEM_PROFILER )
  osal_memset( (byte *)currHdr+HDRSZ, OSALMEM_REIN, (*currHdr - HDRSZ) );
#endif

  HAL_EXIT_CRITICAL_SECTION( intState );  // Re-enable interrupts.
}
开发者ID:gxp,项目名称:node,代码行数:66,代码来源:OSAL_Memory.c


示例8: znpTestRF

/**************************************************************************************************
 * @fn          znpTestRF
 *
 * @brief       This function initializes and checks the ZNP RF Test Mode NV items. It is designed
 *              to be invoked before/instead of MAC radio initialization.
 *
 * input parameters
 *
 * None.
 *
 * output parameters
 *
 * None.
 *
 * @return      None.
 */
void znpTestRF(void)
{
  uint8 rfTestParms[4] = { 0, 0, 0, 0 };

  if ((SUCCESS != osal_nv_item_init(ZNP_NV_RF_TEST_PARMS, 4, rfTestParms))  ||
      (SUCCESS != osal_nv_read(ZNP_NV_RF_TEST_PARMS, 0, 4, rfTestParms)) ||
      (rfTestParms[0] == 0))
  {
    return;
  }

  // Settings from SmartRF Studio
  MDMCTRL0 = 0x85;
  RXCTRL = 0x3F;
  FSCTRL = 0x5A;
  FSCAL1 = 0x2B;
  AGCCTRL1 = 0x11;
  ADCTEST0 = 0x10;
  ADCTEST1 = 0x0E;
  ADCTEST2 = 0x03;

  FRMCTRL0 = 0x43;
  FRMCTRL1 = 0x00;

  MAC_RADIO_RXTX_OFF();
  MAC_RADIO_SET_CHANNEL(rfTestParms[1]);
  MAC_RADIO_SET_TX_POWER(rfTestParms[2]);
  TX_PWR_TONE_SET(rfTestParms[3]);

  switch (rfTestParms[0])
  {
  case 1:  // Rx promiscuous mode.
    MAC_RADIO_RX_ON();
    break;

  case 2:  // Un-modulated Tx.
    TX_PWR_MOD__SET(1);
    // no break;

  case 3:  // Modulated Tx.
    // Modulated is default register setting, so no special action.

    // Now turn on Tx power for either mod or un-modulated Tx test.
    MAC_RADIO_TX_ON();
    break;

  default:  // Not expected.
    break;
  }

  // Clear the RF test mode.
  (void)osal_memset(rfTestParms, 0, 4);
  (void)osal_nv_write(ZNP_NV_RF_TEST_PARMS, 0, 4, rfTestParms);

  while (1);  // Spin in RF test mode until a hard reset.
}
开发者ID:binwulang,项目名称:zstack-agriculture,代码行数:72,代码来源:znp_soc.c


示例9: lock_init

void lock_init(void)
{
  uint8 read_tmp[6] = {0};
  uint8 use_lock_times[2] = {0};
  uint8 ret8;
   
  osal_memset(read_tmp, '0', sizeof(read_tmp));
  ret8 = osal_snv_write(admin_flash_start_addr, sizeof(read_tmp), read_tmp);
  if(ret8 == NV_OPER_FAILED)
     return;

  osal_memset(read_tmp, '1', sizeof(read_tmp));
  ret8 = osal_snv_write(user_flash_start_addr, sizeof(read_tmp), read_tmp);
  if(ret8 == NV_OPER_FAILED)
     return;
    
  osal_memcpy(read_tmp,  ssid,  6);
  ret8 = osal_snv_write(ssid_flash_start_addr, sizeof(read_tmp), read_tmp);
  if(ret8 == NV_OPER_FAILED)
     return;

  osal_memcpy(scanRspData + 2, read_tmp, 6);
  osal_memcpy(attDeviceName, read_tmp, 6);
  GAP_UpdateAdvertisingData( simpleBLEPeripheral_TaskID, FALSE, sizeof( scanRspData ), scanRspData );
  GGS_SetParameter( GGS_DEVICE_NAME_ATT, GAP_DEVICE_NAME_LEN, attDeviceName );
   
  osal_memset(read_tmp, '0', sizeof(read_tmp));
  ret8 = osal_snv_write(dead_date_flash_start_addr, sizeof(read_tmp), read_tmp);
  if(ret8 == NV_OPER_FAILED)
    return;
    
  osal_memset(read_tmp, '0', sizeof(read_tmp));
  ret8 = osal_snv_write(carlock_id_flash_start_addr, sizeof(read_tmp), read_tmp);
  if(ret8 == NV_OPER_FAILED)
     return;

  osal_memset(use_lock_times, 0, sizeof(use_lock_times));
  ret8 = osal_snv_write(use_lock_times_start_addr, sizeof(use_lock_times), use_lock_times);
  if(ret8 == NV_OPER_FAILED)
     return; 
  
  HAL_SYSTEM_RESET();//reset
}
开发者ID:liu470895,项目名称:car_lock,代码行数:43,代码来源:simpleBLETest.c


示例10: zclCCServer_SendLeaveReq

/*********************************************************************
 * @fn      zclCCServer_SendLeaveReq
 *
 * @brief   Send out a Leave Request command.
 *
 * @param   void
 *
 * @return  ZStatus_t
 */
static ZStatus_t zclCCServer_SendLeaveReq( void )
{
  NLME_LeaveReq_t leaveReq;

  // Set every field to 0
  osal_memset( &leaveReq, 0, sizeof( NLME_LeaveReq_t ) );

  // Send out our leave
  return ( NLME_LeaveReq( &leaveReq ) );
}
开发者ID:binwulang,项目名称:zstack-agriculture,代码行数:19,代码来源:zcl_ccserver.c


示例11: zdo_MTCB_MgmtRtgRspCB

/*********************************************************************
 * @fn      zdo_MTCB_MgmtRtgRspCB()
 *
 * @brief
 *
 *   Called to send MT callback response for Management Network
 *   Discover response
 *
 * @param  SrcAddr  - Source address
 * @param  Status - response status
 *
 * @return  none
 */
void zdo_MTCB_MgmtRtgRspCB( uint16 SrcAddr, byte Status,
                        byte RtgCount, byte StartIndex,
                        byte RtgListCount, rtgItem_t *pList )
{
  byte *msgPtr;
  byte *msg;
  byte len;
  byte x;

  /*Allocate a message of size equivalent to the corresponding SPI message
  (plus a couple of bytes for MT use)so that the same buffer can be sent by
  MT to the test tool by simply setting the header bytes.*/

  /*In order to allocate the message , we need to know the length and this
  has to be calculated before we allocate the message*/

  len = 2 + 1 + 1 + 1 + 1 + (ZDP_RTG_DISCRIPTOR_SIZE * ZDO_MAX_RTG_ITEMS);
      //  SrcAddr + Status + RtgCount + StartIndex + RtgListCount
      //     + (maximum entries * size of struct)

  msgPtr = osal_mem_alloc( len );

  if ( msgPtr )
  {
    msg = msgPtr;

    //Fill up the data bytes
    *msg++ = HI_UINT16( SrcAddr );
    *msg++ = LO_UINT16( SrcAddr );
    *msg++ = Status;
    *msg++ = RtgCount;
    *msg++ = StartIndex;
    *msg++ = RtgListCount;

    osal_memset( msg, 0, (ZDP_RTG_DISCRIPTOR_SIZE * ZDO_MAX_RTG_ITEMS) );

    for ( x = 0; x < ZDO_MAX_RTG_ITEMS; x++ )
    {
      if ( x < RtgListCount )
      {
        *msg++ = HI_UINT16( pList->dstAddress );
        *msg++ = LO_UINT16( pList->dstAddress );
        *msg++ = HI_UINT16( pList->nextHopAddress );
        *msg++ = LO_UINT16( pList->nextHopAddress );
        *msg++ = pList->status;
        pList++;
      }
    }

    MT_BuildAndSendZToolCB( SPI_CB_ZDO_MGMT_RTG_RSP, len, msgPtr );

    osal_mem_free( msgPtr );
  }
}
开发者ID:gothame,项目名称:ZigbeeComm,代码行数:67,代码来源:MT_ZDO.c


示例12: Thermometer_Init

/*********************************************************************
 * @fn      Thermometer_Init
 *
 * @brief   Initialization function for the Thermometer App Task.
 *          This is called during initialization and should contain
 *          any application specific initialization (ie. hardware
 *          initialization/setup, table initialization, power up
 *          notificaiton ... ).
 *
 * @param   task_id - the ID assigned by OSAL.  This ID should be
 *                    used to send messages and set timers.
 *
 * @return  none
 */
void Thermometer_Init(uint8 task_id)
{
	struct ther_info *ti = &ther_info;

	osal_memset(ti, 0, sizeof(struct ther_info));

	ti->task_id = task_id;
	ti->power_mode = PM_ACTIVE;

	osal_set_event(ti->task_id, TH_POWER_ON_EVT);
}
开发者ID:yzkqfll,项目名称:ibaby,代码行数:25,代码来源:thermometer.c


示例13: osalInitTasks

/*********************************************************************
 * @fn      osalInitTasks
 *
 * @brief   This function invokes the initialization function for each task.
 *
 * @param   void
 *
 * @return  none
 */
void osalInitTasks( void )
{
  uint8 taskID = 0;

  tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt);
  osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt));

  Hal_Init(taskID++);  // HAL should be a higher priority than any ZNP task.
  zapInit(taskID++);   // ZAP APP should be the highest priority ZNP task.
  pulseAppInit(taskID);  //MHMS registers endpoint and other initialization stuff
}
开发者ID:MobileHealthMonitoringSystem,项目名称:MHMS,代码行数:20,代码来源:OSAL_TVSA.c


示例14: _stp_dbg_disable

static INT32 _stp_dbg_disable (MTKSTP_DBG_T *stp_dbg)
{
    osal_lock_unsleepable_lock(&(stp_dbg->logsys->lock));
    stp_dbg->pkt_trace_no = 0;

    /* [FIXME][George] DANGEROUS CODING to MEMSET A STRUCTURE in a NON-INIT
     * or a NON-DEINIT CONTEXT!!!
     */
#if 0
    osal_memset(stp_dbg->logsys,0,osal_sizeof(MTKSTP_LOG_SYS_T));
#else
    osal_memset(&stp_dbg->logsys->queue[0], 0x0, sizeof(stp_dbg->logsys->queue));
    stp_dbg->logsys->size = 0;
    stp_dbg->logsys->in = 0;
    stp_dbg->logsys->out = 0;
#endif
    stp_dbg->is_enable = 0;
    osal_unlock_unsleepable_lock(&(stp_dbg->logsys->lock));

    return 0;
}
开发者ID:32743069,项目名称:amlogic_common_3050,代码行数:21,代码来源:stp_dbg.c


示例15: zclCCServer_UseStartupParameters

/*********************************************************************
 * @fn      zclCCServer_UseStartupParameters
 *
 * @brief   Set the network parameters to the current Startup Parameters.
 *
 * @param   none
 *
 * @return  none
 */
static void zclCCServer_UseStartupParameters( void )
{
  if ( zclCCServer_StartUpControl == CC_STARTUP_CONTROL_OPTION_1 )
  {
    uint8 networkKey[SEC_KEY_LEN];

    // Form the Commissioning network and become the Coordinator for that network

    // Required attributes: Extended PAN ID
    osal_nv_write( ZCD_NV_EXTENDED_PAN_ID, 0, Z_EXTADDR_LEN, 
                   zclCCServer_ExtendedPanId );
    osal_nv_write( ZCD_NV_APS_USE_EXT_PANID, 0, Z_EXTADDR_LEN, 
                   zclCCServer_ExtendedPanId );

    // Optional attributes: PAN ID, Channel Mask, Network Manager Address,
    // Network Key, Network Key Type (only KEY_TYPE_NWK is currently supported),
    // and Trust Center Address (which is used with Preconfigured Link Key).
    osal_nv_write( ZCD_NV_PANID, 0, sizeof( zclCCServer_PanId ), 
                   &zclCCServer_PanId );

    osal_nv_write( ZCD_NV_CHANLIST, 0, sizeof( zclCCServer_ChannelMask ), 
                   &zclCCServer_ChannelMask );

    osal_nv_write( ZCD_NV_NWKMGR_ADDR, 0, sizeof( zclCCServer_NwkManagerAddr ),
                   &zclCCServer_NwkManagerAddr );

    osal_nv_read( ZCD_NV_SAS_CURR_NWK_KEY, 0, SEC_KEY_LEN, networkKey );
    if ( !nullKey( networkKey ) )
    {
      // Save the Network Key as the Pre-Configured Key in NV
      osal_nv_write( ZCD_NV_PRECFGKEY, 0, SEC_KEY_LEN, networkKey );

      // Clear copy of key in RAM
      osal_memset( networkKey, 0x00, SEC_KEY_LEN );
    }
  }
  else if ( zclCCServer_StartUpControl == CC_STARTUP_CONTROL_OPTION_3 )
  {
     // Join the Commissioning network

    // Required attributes: none

    // Optional attributes: Extended PAN ID, Channel Mask, and 
    // Preconfigured Link Key
    osal_nv_write( ZCD_NV_EXTENDED_PAN_ID, 0, Z_EXTADDR_LEN, 
                   zclCCServer_ExtendedPanId );

    osal_nv_write( ZCD_NV_CHANLIST, 0, sizeof( zclCCServer_ChannelMask ), 
                   &zclCCServer_ChannelMask );

    zclCCServer_SavePreconfigLinkKey();
  }
}
开发者ID:binwulang,项目名称:zstack-agriculture,代码行数:62,代码来源:zcl_ccserver.c


示例16: zllSampleBridge_InitLinkedTargets

/*********************************************************************
 * @fn      zllSampleBridge_InitLinkedTargets()
 *
 * @brief   Initialize linked targets and controlled groups lists in NV.
 *
 * @param   none
 *
 * @return  none
 */
static void zllSampleBridge_InitLinkedTargets( void )
{
  uint8 i;
  osal_memset( &linkedTargets, 0xFF, sizeof(linkedTargets));
  zll_ItemInit( ZCD_NV_ZLL_BRIDGE_LINK_TARGETS, sizeof(zllBridgeLinkedTargetList_t), &linkedTargets );
  linkedAddrNum = 0;
  for (i = 0; i < MAX_LINKED_TARGETS; i++ )
  {
    if ( linkedTargets.arr[i].Addr != 0xFFFF )
    {
      linkedAddrNum++;
    }
  }
  if ( linkedAddrNum < MAX_LINKED_TARGETS )
  {
    linkedAddrNextIdx = linkedAddrNum;
  }
  // init controlled groups list
  osal_memset( &controlledGroups, 0x00, sizeof(controlledGroups));
  zll_ItemInit( ZCD_NV_ZLL_BRIDGE_CTRL_GROUPS, sizeof(zllBridgeControlledGroupsList_t), &controlledGroups );
}
开发者ID:saiwaiyanyu,项目名称:Zlight,代码行数:30,代码来源:zll_samplebridge.c


示例17: wmt_idc_deinit

INT32 wmt_idc_deinit(VOID)
{
	INT32 iRet;

	iRet = mtk_conn_md_bridge_unreg(gWmtIdcInfo.iit.src_mod_id);
	if (iRet)
		WMT_ERR_FUNC("mtk_conn_md_bridge_unreg fail(%d)\n", iRet);

	osal_memset(&gWmtIdcInfo, 0, osal_sizeof(gWmtIdcInfo));

	return 0;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:12,代码来源:wmt_idc.c


示例18: ther_buzzer_init

void ther_buzzer_init(unsigned char task_id)
{
	struct ther_buzzer *b = &buzzer;

	print(LOG_INFO, MODULE "buzzer init\n");

	osal_memset(b, 0, sizeof(struct ther_buzzer));

	b->task_id = task_id;

	P1_BUZZER_PIN = 1;
}
开发者ID:yzkqfll,项目名称:ibaby,代码行数:12,代码来源:ther_buzzer.c


示例19: osalInitTasks

/*********************************************************************
 * @fn      osalInitTasks
 *
 * @brief   This function invokes the initialization function for each task.
 *
 * @param   void
 *
 * @return  none
 */
void osalInitTasks( void )
{
  uint8 taskID = 0;

  tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt);
  osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt));

  Hal_Init(taskID++);  // HAL should be a higher priority than any ZNP task.
  zapInit(taskID++);   // ZAP APP should be the highest priority ZNP task.
  zcl_Init( taskID++ );
  ipd_Init( taskID );
}
开发者ID:MobileHealthMonitoringSystem,项目名称:MHMS,代码行数:21,代码来源:OSAL_ipd.c


示例20: WechatSendStoredAuth

/*********************************************************************
 * @fn      WechatSendStoredAuth
 *
 * @brief   Send a stored measurement indication. An incoming indication
 *          confirmation will trigger the next pending stored measurement.
 *
 * @return  none
 */
void WechatSendStoredAuth(void)
{
  // We connected to this peer before so send any stored measurements
  if (wechatStoreStartIndex != wechatStoreIndex)
  {
    attHandleValueInd_t *pStoreInd = &wechatStoreAuth[wechatStoreStartIndex];

#if 0
		NPI_Printf("\r\n##send %d[%d] wechat data: ", wechatStoreStartIndex, pStoreInd->len);
		for(uint8 i=0;i> pStoreInd->len;++i)
		{
			NPI_Printf(" %x", pStoreInd->pValue[i]);
		}
		NPI_Printf("\r\n");
#endif

    // Send wechat auth - can fail if not connected or CCC not enabled
    bStatus_t status = Wechat_Indicate( gapConnHandle, pStoreInd,
                                                   simpleBLEPeripheral_TaskID );
    // If sucess, increment the counters and the indication confirmation
    // will trigger the next indication if there are more pending.
    if (status == SUCCESS)
    {

      // Clear out this Meas indication.
      VOID osal_memset( pStoreInd, 0, sizeof(attHandleValueInd_t) );

      wechatStoreStartIndex ++;

      // Wrap around buffer
      if (wechatStoreStartIndex > WECHAT_AUTH_STORE_MAX)
      {
        wechatStoreStartIndex = 0;
      }

			//osal_start_timerEx( simpleBLEPeripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD );
    }
		else
		{
			//osal_stop_timerEx( simpleBLEPeripheral_TaskID, WECHAT_CCC_UPDATE_EVT);
			NPI_Printf("Send %d failed %d \r\n", wechatStoreStartIndex, status);
			//osal_start_timerEx( simpleBLEPeripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD );
		}
  }
	else
	{
		//NPI_Printf("wechat send end\r\n");
		wechatStoreIndex=0;
		wechatStoreStartIndex=0;
		osal_stop_timerEx( simpleBLEPeripheral_TaskID, WECHAT_CCC_UPDATE_EVT);
	}
}
开发者ID:billy-wang,项目名称:IOT,代码行数:60,代码来源:wechatapp.c



注:本文中的osal_memset函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ osal_msg_deallocate函数代码示例发布时间:2022-05-30
下一篇:
C++ osal_memcpy函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap