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

C++ osal_strlen函数代码示例

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

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



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

示例1: WMT_read

ssize_t WMT_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
{
	INT32 iRet = 0;
	PUINT8 pCmd = NULL;
	UINT32 cmdLen = 0;
	pCmd = wmt_lib_get_cmd();

	if (pCmd != NULL) {
		cmdLen = osal_strlen(pCmd) < NAME_MAX ? osal_strlen(pCmd) : NAME_MAX;
		WMT_DBG_FUNC("cmd str(%s)\n", pCmd);
		if (copy_to_user(buf, pCmd, cmdLen)) {
			iRet = -EFAULT;
		} else {
			iRet = cmdLen;
		}
	}
#if 0
	if (test_and_clear_bit(WMT_STAT_CMD, &pWmtDevCtx->state)) {
		iRet = osal_strlen(localBuf) < NAME_MAX ? osal_strlen(localBuf) : NAME_MAX;
		/* we got something from STP driver */
		WMT_DBG_FUNC("copy cmd to user by read:%s\n", localBuf);
		if (copy_to_user(buf, localBuf, iRet)) {
			iRet = -EFAULT;
			goto read_done;
		}
	}
#endif
	return iRet;
}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:29,代码来源:wmt_dev.c


示例2: wmt_dev_is_file_exist

MTK_WCN_BOOL wmt_dev_is_file_exist(PUINT8 pFileName)
{
	struct file *fd = NULL;
	/* ssize_t iRet; */
	INT32 fileLen = -1;
	const struct cred *cred = get_current_cred();
	if (pFileName == NULL) {
		WMT_ERR_FUNC("invalid file name pointer(%p)\n", pFileName);
		return MTK_WCN_BOOL_FALSE;
	}
	if (osal_strlen(pFileName) < osal_strlen(defaultPatchName)) {
		WMT_ERR_FUNC("invalid file name(%s)\n", pFileName);
		return MTK_WCN_BOOL_FALSE;
	}

	/* struct cred *cred = get_task_cred(current); */

	fd = filp_open(pFileName, O_RDONLY, 0);
	if (!fd || IS_ERR(fd) || !fd->f_op || !fd->f_op->read) {
		WMT_ERR_FUNC("failed to open or read(%s)!(0x%p, %d, %d)\n", pFileName, fd,
			     cred->fsuid, cred->fsgid);
		return MTK_WCN_BOOL_FALSE;
	}
	fileLen = fd->f_path.dentry->d_inode->i_size;
	filp_close(fd, NULL);
	fd = NULL;
	if (fileLen <= 0) {
		WMT_ERR_FUNC("invalid file(%s), length(%d)\n", pFileName, fileLen);
		return MTK_WCN_BOOL_FALSE;
	}
	WMT_ERR_FUNC("valid file(%s), length(%d)\n", pFileName, fileLen);
	return true;

}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:34,代码来源:wmt_dev.c


示例3: HalLcdWriteStringValueValue

/**************************************************************************************************
 * @fn      HalLcdWriteStringValue
 *
 * @brief   Write a string followed by a value to the LCD
 *
 * @param   title   - Title that will be displayed before the value
 *          value1  - value #1
 *          format1 - redix of value #1
 *          value2  - value #2
 *          format2 - redix of value #2
 *          line    - line number
 *
 * @return  None
 **************************************************************************************************/
void HalLcdWriteStringValueValue( char *title, uint16 value1, uint8 format1,
                                  uint16 value2, uint8 format2, uint8 line )
{

#if (HAL_LCD == TRUE)
  uint8 tmpLen;
  uint8 buf[LCD_MAX_BUF];
  uint32 err;

  tmpLen = (uint8)osal_strlen( (char*)title );
  if ( tmpLen )
  {
    osal_memcpy( buf, title, tmpLen );
    buf[tmpLen++] = ' ';
  }

  err = (uint32)(value1);
  _ltoa( err, &buf[tmpLen], format1 );
  tmpLen = (uint8)osal_strlen( (char*)buf );

  buf[tmpLen++] = ',';
  buf[tmpLen++] = ' ';
  err = (uint32)(value2);
  _ltoa( err, &buf[tmpLen], format2 );

  HalLcdWriteString( (char *)buf, line );		

#endif
}
开发者ID:MobileHealthMonitoringSystem,项目名称:MHMS,代码行数:43,代码来源:hal_lcd.c


示例4: HalLcdWriteString

/**************************************************************************************************
 * @fn      HalLcdWriteString
 *
 * @brief   Write a string to the LCD
 *
 * @param   str    - pointer to the string that will be displayed
 *          option - display options
 *
 * @return  None
 **************************************************************************************************/
void HalLcdWriteString ( char *str, uint8 option)
{
#if (HAL_LCD == TRUE)
  uint8 strLen = 0;
  uint8 totalLen = 0;
  uint8 *buf;
  uint8 tmpLen;

  if ( Lcd_Line1 == NULL )
  {
    Lcd_Line1 = osal_mem_alloc( HAL_LCD_MAX_CHARS+1 );
    HalLcdWriteString( "TexasInstruments", 1 );
  }

  strLen = (uint8)osal_strlen( (char*)str );

  /* Check boundries */
  if ( strLen > HAL_LCD_MAX_CHARS )
    strLen = HAL_LCD_MAX_CHARS;

  if ( option == HAL_LCD_LINE_1 )
  {
    /* Line 1 gets saved for later */
    osal_memcpy( Lcd_Line1, str, strLen );
    Lcd_Line1[strLen] = '\0';
  }
  else
  {
    /* Line 2 triggers action */
    tmpLen = (uint8)osal_strlen( (char*)Lcd_Line1 );
    totalLen =  tmpLen + 1 + strLen + 1;
    buf = osal_mem_alloc( totalLen );
    if ( buf != NULL )
    {
      /* Concatenate strings */
      osal_memcpy( buf, Lcd_Line1, tmpLen );
      buf[tmpLen++] = ' ';
      osal_memcpy( &buf[tmpLen], str, strLen );
      buf[tmpLen+strLen] = '\0';

      /* Send it out */
#if defined (ZTOOL_P1) || defined (ZTOOL_P2)
      debug_str( (uint8*)buf );
#endif //ZTOOL_P1

      /* Free mem */
      osal_mem_free( buf );
    }
  }

  /* Display the string */
  HalLcd_HW_WriteLine (option, str);

#endif //HAL_LCD
}
开发者ID:MobileHealthMonitoringSystem,项目名称:MHMS,代码行数:65,代码来源:hal_lcd.c


示例5: zb_ReceiveDataIndication

void zb_ReceiveDataIndication( uint16 source, uint16 command, uint16 len, uint8 *pData  )
{
  uint8 buf[32];
  uint8 *pBuf;
  uint8 tmpLen;
  uint8 sensorReading;

  if (command == SENSOR_REPORT_CMD_ID)
  {
    // Received report from a sensor
    sensorReading = pData[1];

    // If tool available, write to serial port

    tmpLen = (uint8)osal_strlen( (char*)strDevice );
    pBuf = osal_memcpy( buf, strDevice, tmpLen );
    _ltoa( source, pBuf, 16 );
    pBuf += 4;
    *pBuf++ = ' ';

    if ( pData[0] == BATTERY_REPORT )
    {
      tmpLen = (uint8)osal_strlen( (char*)strBattery );
      pBuf = osal_memcpy( pBuf, strBattery, tmpLen );

      *pBuf++ = (sensorReading / 10 ) + '0';    // convent msb to ascii
      *pBuf++ = '.';                            // decimal point ( battery reading is in units of 0.1 V
      *pBuf++ = (sensorReading % 10 ) + '0';    // convert lsb to ascii
      *pBuf++ = ' ';
      *pBuf++ = 'V';
    }
    else
    {
      tmpLen = (uint8)osal_strlen( (char*)strTemp );
      pBuf = osal_memcpy( pBuf, strTemp, tmpLen );

      *pBuf++ = (sensorReading / 10 ) + '0';    // convent msb to ascii
      *pBuf++ = (sensorReading % 10 ) + '0';    // convert lsb to ascii
      *pBuf++ = ' ';
      *pBuf++ = 'C';
    }

    *pBuf++ = '\r';
    *pBuf++ = '\n';
    *pBuf = '\0';

#if defined( MT_TASK )
    debug_str( (uint8 *)buf );
#endif

    // can also write directly to uart

  }
}
开发者ID:GitYun,项目名称:ZigBee-Network,代码行数:54,代码来源:SimpleCollector.c


示例6: wcn_core_dump_flush

/* wcn_core_dump_flush - Fulsh dump data and reset core dump sys
 *
 * Retunr 0 if success, else error code
 */
INT32 wcn_core_dump_flush(INT32 rst)
{
    PUINT8 pbuf = NULL;
    INT32 len = 0;
    INT32 ret = 0;

    if (!g_core_dump) {
        STP_DBG_ERR_FUNC("invalid pointer!\n");
        return -1;
    }

    wcn_core_dump_out(g_core_dump, &pbuf, &len);
    STP_DBG_INFO_FUNC("buf 0x%08x, len %d\n", (unsigned int)pbuf, len);
            
    // show coredump end info on UI
    //osal_dbg_assert_aee("MT662x f/w coredump end", "MT662x firmware coredump ends");
    #if WMT_PLAT_ALPS
    aee_kernel_dal_show("MT662x coredump end\n");
            
    ret = stp_dbg_set_fw_info(pbuf, 512, STP_FW_ASSERT_ISSUE);
    if (ret) {
        STP_DBG_ERR_FUNC("set fw issue infor fail(%d),maybe fw warm reset...\n", ret);
        stp_dbg_set_fw_info("Fw Warm reset", osal_strlen("Fw Warm reset"), STP_FW_WARM_RST_ISSUE);
    }

    // call AEE driver API
    aed_combo_exception(NULL, 0, (const int*)pbuf, len, (const char*)g_core_dump->info);
    #endif
    // reset
    wcn_core_dump_reset(g_core_dump, STP_CORE_DUMP_TIMEOUT);
    
    return 0;
}
开发者ID:Scorpio92,项目名称:mediatek,代码行数:37,代码来源:stp_dbg.c


示例7: ParkWay_SendTheMessage

//This function send the status of own park to the coordinator
static void ParkWay_SendTheMessage( void )
{
  uint8 pData[6];
  pData[0] = 'E';
  pData[1] = 'D';
  pData[2] = DEVICE_PW_1;
  pData[3] = DEVICE_PW_2;
  pData[4] = '-';
  pData[5] = vaga;

  //Send data to the coordinator ADDRESS(0000)
  if ( AF_DataRequest( &ParkWay_DstAddr, &ParkWay_epDesc,
                       ParkWay_CLUSTERID,
                       (byte)osal_strlen( pData ) + 1,
                       (byte *)&pData,
                       &ParkWay_TransID,
                       AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
  {
    // Successfully requested to be sent.
  }
  else
  {
    osal_stop_timerEx( ParkWay_TaskID,
                        ParkWay_SEND_MSG_EVT);
    osal_start_timerEx( ParkWay_TaskID,
                        POLLING_OF_DEV_EVT,
                        200);
  }
}
开发者ID:aignacio,项目名称:Smartbee-Network-,代码行数:30,代码来源:PW_EndDevice.c


示例8: _stp_trigger_firmware_assert_via_emi

INT32 _stp_trigger_firmware_assert_via_emi(VOID)
{
    INT32 status = -1;
	INT32 j = 0;

	wmt_plat_force_trigger_assert(STP_FORCE_TRG_ASSERT_DEBUG_PIN);

	do {  
        if(0 != mtk_wcn_stp_coredump_start_get()){
            status = 0;
            break;
        }
		
		stp_dbg_poll_cpupcr(5 , 1 , 1);
		stp_dbg_poll_dmaregs(5 , 1);
		j++;
		STP_BTM_INFO_FUNC("Wait for assert message (%d)\n", j);
		osal_sleep_ms(20); 
        if(j > 49) { /* wait for 1 second*/
			stp_dbg_set_fw_info("host trigger fw assert timeout",
				osal_strlen("host trigger fw assert timeout"),STP_HOST_TRIGGER_ASSERT_TIMEOUT);
			wcn_core_dump_timeout();/* trigger collect SYS_FTRACE*/
            break;   
        }
    } while(1);
    
    return status;
}
开发者ID:Jlsmily,项目名称:android_kernel_meilan2,代码行数:28,代码来源:btm_core.c


示例9: wmt_conf_parse_int

static int wmt_conf_parse_int(P_DEV_WMT pWmtDev, const struct parse_data *data, const PINT8 pos)
{
	PUINT32 dst;
	long res;
	int ret;
	dst = (PINT32) (((PUINT8) pWmtDev) + (long)data->param1);

	/* WMT_INFO_FUNC(">strlen(pos)=%d\n", strlen(pos)); */

	if ((osal_strlen(pos) > 2) && ((*pos) == '0') && (*(pos + 1) == 'x')) {
		ret = osal_strtol(pos + 2, 16, &res);
		if (ret)
			WMT_ERR_FUNC("fail(%d)\n", ret);
		*dst = res;
		WMT_DBG_FUNC("wmtcfg==> %s=0x%x\n", data->name, *dst);
	} else {
		ret = osal_strtol(pos, 10, &res);
		if (ret)
			WMT_ERR_FUNC("fail(%d)\n", ret);
		*dst = res;
		WMT_DBG_FUNC("wmtcfg==> %s=%d\n", data->name, *dst);
	}

	return 0;
}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:25,代码来源:wmt_conf.c


示例10: debug_str

/*********************************************************************
 * @fn      debug_str
 *
 * @brief
 *
 *   This feature allows modules to display a debug text string as
 *   applications execute in real-time. This feature will output to
 *   the serial port for display in the Z-Test tool.
 *
 *   This feature will most likely be compiled out in the production
 *   code in order to save code space.
 *
 * @param   byte *str_ptr - pointer to null-terminated string
 *
 * @return  void
 */
void debug_str( byte *str_ptr )
{
  mtDebugStr_t *msg;
  byte mln;
  byte strLen;

  // Text string length
  strLen = (byte)osal_strlen( (void*)str_ptr );

  // Debug string message length
  mln = sizeof ( mtDebugStr_t ) + strLen;

  // Get a message buffer to build the debug message
  msg = (mtDebugStr_t *)osal_msg_allocate( mln );
  if ( msg )
  {
    // Message type, length
    msg->hdr.event = CMD_DEBUG_STR;
    msg->strLen = strLen;

    // Append message, no terminator
    msg->pString = (uint8 *)(msg+1);
    osal_memcpy ( msg->pString, str_ptr, strLen );

    osal_msg_send( MT_TaskID, (uint8 *)msg );
  }
} // debug_str()
开发者ID:Daan1992,项目名称:WSN-Lab,代码行数:43,代码来源:DebugTrace.c


示例11: performPeriodicTask

static void performPeriodicTask( void )
{
   //static bool a = true;
   //a = !a;
   //HalLedSet(HAL_LED_1,a);
   
#if 0   
   char strTemp[35] = {0};
   sprintf(strTemp, "led1 = %d\r\n",a);
   NPI_WriteTransport((uint8*)strTemp, osal_strlen(strTemp));
#endif
   
   if ( simpleBLEState == BLE_STATE_CONNECTED && simpleBLEProcedureInProgress == FALSE )
    {
      uint8 status;
      attReadReq_t req;
        
      req.handle = simpleBLECharHdl;
      status = GATT_ReadCharValue( simpleBLEConnHandle, &req, simpleBLETaskId );
#if 0      
      sprintf(strTemp, "read status = %d\r\n",status);
      NPI_WriteTransport((uint8*)strTemp, osal_strlen(strTemp));
#endif
    }
   
#if 0  
  uint8 valueToCopy;
  uint8 stat;
  

  // Call to retrieve the value of the third characteristic in the profile
  stat = SimpleProfile_GetParameter( SIMPLEPROFILE_CHAR3, &valueToCopy);

  if( stat == SUCCESS )
  {
    /*
     * Call to set that value of the fourth characteristic in the profile. Note
     * that if notifications of the fourth characteristic have been enabled by
     * a GATT client device, then a notification will be sent every time this
     * function is called.
     */
    SimpleProfile_SetParameter( SIMPLEPROFILE_CHAR4, sizeof(uint8), &valueToCopy);

  }
#endif
}
开发者ID:tanxjian,项目名称:BLE-CC254x-1.3.2,代码行数:46,代码来源:simpleBLECentral.c


示例12: wmt_conf_set_cfg_file

INT32 wmt_conf_set_cfg_file(const char *name)
{
	if (NULL == name) {
		WMT_ERR_FUNC("name is NULL\n");
		return -1;
	}
	if (osal_strlen(name) >= osal_sizeof(gDevWmt.cWmtcfgName)) {
		WMT_ERR_FUNC("name is too long, length=%d, expect to < %d\n", osal_strlen(name),
			     osal_sizeof(gDevWmt.cWmtcfgName));
		return -2;
	}
	osal_memset(&gDevWmt.cWmtcfgName[0], 0, osal_sizeof(gDevWmt.cWmtcfgName));
	osal_strcpy(&(gDevWmt.cWmtcfgName[0]), name);
	WMT_ERR_FUNC("WMT config file is set to (%s)\n", &(gDevWmt.cWmtcfgName[0]));

	return 0;
}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:17,代码来源:wmt_conf.c


示例13: wmt_conf_read_file

INT32 wmt_conf_read_file(VOID)
{
	INT32 ret = -1;

	osal_memset(&gDevWmt.rWmtGenConf, 0, osal_sizeof(gDevWmt.rWmtGenConf));
	osal_memset(&gDevWmt.pWmtCfg, 0, osal_sizeof(gDevWmt.pWmtCfg));

#if 1
	osal_memset(&gDevWmt.cWmtcfgName[0], 0, osal_sizeof(gDevWmt.cWmtcfgName));

	osal_strncat(&(gDevWmt.cWmtcfgName[0]), CUST_CFG_WMT_PREFIX, osal_sizeof(CUST_CFG_WMT_PREFIX));
	osal_strncat(&(gDevWmt.cWmtcfgName[0]), CUST_CFG_WMT, osal_sizeof(CUST_CFG_WMT));
#endif

	if (!osal_strlen(&(gDevWmt.cWmtcfgName[0]))) {
		WMT_ERR_FUNC("empty Wmtcfg name\n");
		osal_assert(0);
		return ret;
	}
	WMT_INFO_FUNC("WMT config file:%s\n", &(gDevWmt.cWmtcfgName[0]));
	if (0 == wmt_dev_patch_get(&gDevWmt.cWmtcfgName[0], (osal_firmware **) &gDevWmt.pWmtCfg, 0)) {
		/*get full name patch success */
		WMT_INFO_FUNC("get full file name(%s) buf(0x%p) size(%d)\n",
			      &gDevWmt.cWmtcfgName[0], gDevWmt.pWmtCfg->data, gDevWmt.pWmtCfg->size);

		if (0 == wmt_conf_parse(&gDevWmt, (const PINT8)gDevWmt.pWmtCfg->data, gDevWmt.pWmtCfg->size)) {
			/*config file exists */
			gDevWmt.rWmtGenConf.cfgExist = 1;

			WMT_INFO_FUNC("&gDevWmt.rWmtGenConf=%p\n", &gDevWmt.rWmtGenConf);
			ret = 0;
		} else {
			WMT_ERR_FUNC("wmt conf parsing fail\n");
			osal_assert(0);
			ret = -1;
		}
		wmt_dev_patch_put((osal_firmware **) &gDevWmt.pWmtCfg);
/*
	if (gDevWmt.pWmtCfg)
	{
	    if (gDevWmt.pWmtCfg->data)
	    {
		osal_free(gDevWmt.pWmtCfg->data);
	    }
	    osal_free(gDevWmt.pWmtCfg);
	    gDevWmt.pWmtCfg = 0;
	}
*/
		return ret;
	} else {
		WMT_ERR_FUNC("read %s file fails\n", &(gDevWmt.cWmtcfgName[0]));
		osal_assert(0);

		gDevWmt.rWmtGenConf.cfgExist = 0;
		return ret;
	}
}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:57,代码来源:wmt_conf.c


示例14: hifsdiod_start

INT32 hifsdiod_start(void)
{
    int iRet = -1;
	init_waitqueue_head(&gHifsdiodEvent);
#if 0
    osal_event_init(&gHifsdiodEvent);
    gConIdQueryThread.pThreadData = (VOID *)NULL;
    gConIdQueryThread.pThreadFunc = (VOID *)hif_sdio_proc;
    osal_memcpy(gConIdQueryThread.threadName, gConIdQueryName , osal_strlen(gConIdQueryName));
	

    iRet = osal_thread_create(&gConIdQueryThread);
    if (iRet < 0) 
    {
        HIF_SDIO_ERR_FUNC("osal_thread_create fail...\n");
        goto ERR_EXIT1;
    }
#else
    gConIdQueryThread = kthread_create(hif_sdio_proc, NULL, gConIdQueryName);
    if (NULL == gConIdQueryThread) 
    {
        HIF_SDIO_ERR_FUNC("osal_thread_create fail...\n");
        goto ERR_EXIT1;
    }

#endif

#if 0
    /* Start STPd thread*/
    iRet = osal_thread_run(&gConIdQueryThread);
    if(iRet < 0)
    {
        HIF_SDIO_ERR_FUNC("osal_thread_run FAILS\n");
        goto ERR_EXIT1;
    }
#else
    if (gConIdQueryThread) {
        wake_up_process(gConIdQueryThread);
    }
	else
	{
	    goto ERR_EXIT1;
	}
#endif
    iRet = 0;
	HIF_SDIO_INFO_FUNC("succeed\n");

	return iRet;
	
ERR_EXIT1:
	HIF_SDIO_ERR_FUNC("failed\n");
	return iRet;
 }
开发者ID:Android-Dongyf,项目名称:itop-kernel,代码行数:53,代码来源:hif_sdio_chrdev.c


示例15: NPI_PrintValue

/*
打印指定的格式的数值
参数
title,前缀字符串
value,需要显示的数值
format,需要显示的进制,十进制为10,十六进制为16
*/
void NPI_PrintValue(char *title, uint16 value, uint8 format)
{
  uint8 tmpLen;
  uint8 buf[128];
  uint32 err;

  tmpLen = (uint8)osal_strlen( (char*)title );
  osal_memcpy( buf, title, tmpLen );
  buf[tmpLen] = ' ';
  err = (uint32)(value);
  _ltoa( err, &buf[tmpLen+1], format );
  NPI_PrintString(buf);		
}
开发者ID:XMingyu,项目名称:BLE,代码行数:20,代码来源:npi.c


示例16: custom_set_dn

// Input buffer at least 21 bytes (couting tailing zero)
void custom_set_dn(uint8 *dn)
{
    uint8 idx = 0;
    uint8 buf[CUSTOM_DN_MAGIC_LEN + CUSTOM_DN_LEN] = {0};

    for (idx = 0; idx < (CUSTOM_DN_MAGIC_LEN + CUSTOM_DN_LEN); idx++) {
        buf[idx] = 0;
    }
    dn[CUSTOM_DN_LEN] = 0;
    HalFlashErase(CUSTOM_DN_PAGE_IDX);

    osal_memcpy(buf, dn_magic, CUSTOM_DN_MAGIC_LEN);
    osal_memcpy((buf + CUSTOM_DN_MAGIC_LEN), dn, osal_strlen((char *)dn));
    HalFlashWrite((((uint32)CUSTOM_DN_PAGE_IDX * (uint32)2048 + CUSTOM_DN_MGIC_OFFSET) / 4), buf, (CUSTOM_DN_MAGIC_LEN + CUSTOM_DN_LEN) / 4); 
}
开发者ID:qodome,项目名称:Firmware,代码行数:16,代码来源:customize.c


示例17: HalLcdWriteStringValue

/**************************************************************************************************
 * @fn      HalLcdWriteStringValue
 *
 * @brief   Write a string followed by a value to the LCD
 *
 * @param   title  - Title that will be displayed before the value
 *          value  - value
 *          format - redix
 *          line   - line number
 *
 * @return  None
 **************************************************************************************************/
void HalLcdWriteStringValue( char *title, uint16 value, uint8 format, uint8 line )
{
#if (HAL_LCD == TRUE)
  uint8 tmpLen;
  uint8 buf[LCD_MAX_BUF];
  uint32 err;

  tmpLen = (uint8)osal_strlen( (char*)title );
  osal_memcpy( buf, title, tmpLen );
  buf[tmpLen] = ' ';
  err = (uint32)(value);
  _ltoa( err, &buf[tmpLen+1], format );
  HalLcdWriteString( (char*)buf, line );		
#endif
}
开发者ID:MobileHealthMonitoringSystem,项目名称:MHMS,代码行数:27,代码来源:hal_lcd.c


示例18: wmt_conf_parse_char

static int wmt_conf_parse_char(P_DEV_WMT pWmtDev, const struct parse_data *data,
                 const PCHAR pos)
{
    PUCHAR dst;
    dst = (PCHAR ) (((PUINT8) pWmtDev) + (LONG) data->param1);

    if((osal_strlen(pos) > 2) &&
        ((*pos)=='0') && (*(pos+1)=='x') ){
        *dst = osal_strtol(pos+2, NULL, 16);
        WMT_DBG_FUNC("wmtcfg==> %s=0x%x\n", data->name, *dst);
    } else {
        *dst = osal_strtol(pos, NULL, 10);
        WMT_DBG_FUNC("wmtcfg==> %s=%d\n", data->name, *dst);
    }
    return 0;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:16,代码来源:wmt_conf.c


示例19: HalLcd_HW_WriteLine

/**************************************************************************************************
作用    向指定行写入一串字符串
参数1   line。范围1~8
参数2   pText。待显示的字符串
 **************************************************************************************************/
void HalLcd_HW_WriteLine(uint8 line, const char *pText)
{
  uint8 count;
  uint8 totalLength = (uint8)osal_strlen( (char *)pText );
  /* Write the content first */
  for (count=0; count<totalLength; count++)
  {
    HalLcd_HW_WriteChar(line, count, (*(pText++)));
  }

  /* Write blank spaces to rest of the line */
  for(count=totalLength; count<LCD_MAX_LINE_LENGTH;count++)
  {
    HalLcd_HW_WriteChar(line, count, 0x00);
  }
}
开发者ID:zekezang,项目名称:BLE-CC254x-1.3,代码行数:21,代码来源:hal_lcd.c


示例20: Uart_Msg_Calculate_Checkcode

/***************************************************************************************************
 * @fn      Uart_Msg_Retransform
 *
 * @brief   handle uart1 Msg,this msg was came from e009 uart1
 *
 * @param   pBuffer: msg; length: msg length
 *
 * @return  None
 ***************************************************************************************************/
uint8 Uart_Msg_Calculate_Checkcode(uint8 *pBuffer, uint8 length )
{
    uint8 i;
    uint8 checkCode, checkCodeLocation;
    checkCode = pBuffer[1];
    checkCodeLocation = length - 2;
    for( i = 2; i < checkCodeLocation; i++ )
    {
      checkCode = checkCode ^ pBuffer[i];
    }
#if 0
    char strTemp[50] = {0}; 
    sprintf(strTemp, "checkCode=0x%x,%d\r\n",checkCode,checkCodeLocation);
    NPI_WriteTransport((uint8*)strTemp, osal_strlen(strTemp));
#endif
    return checkCode;
}
开发者ID:tanxjian,项目名称:BLE-CC254x-1.3.2,代码行数:26,代码来源:uartInterface.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ osal_task_sleep函数代码示例发布时间:2022-05-30
下一篇:
C++ osal_stop_timerEx函数代码示例发布时间: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