本文整理汇总了C++中HalLcdWriteString函数的典型用法代码示例。如果您正苦于以下问题:C++ HalLcdWriteString函数的具体用法?C++ HalLcdWriteString怎么用?C++ HalLcdWriteString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HalLcdWriteString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: HalLcdDisplayPercentBar
/**************************************************************************************************
z-stack代码,未修改
**************************************************************************************************/
void HalLcdDisplayPercentBar( char *title, uint8 value )
{
#if (HAL_LCD == TRUE)
uint8 percent;
uint8 leftOver;
uint8 buf[17];
uint32 err;
uint8 x;
/* Write the title: */
HalLcdWriteString( title, HAL_LCD_LINE_1 );
if ( value > 100 )
value = 100;
/* convert to blocks */
percent = (uint8)(value / 10);
leftOver = (uint8)(value % 10);
/* Make window */
osal_memcpy( buf, "[ ] ", 15 );
for ( x = 0; x < percent; x ++ )
{
buf[1+x] = '>';
}
if ( leftOver >= 5 )
buf[1+x] = '+';
err = (uint32)value;
_ltoa( err, (uint8*)&buf[13], 10 );
HalLcdWriteString( (char*)buf, HAL_LCD_LINE_2 );
#endif
}
开发者ID:reyno123456,项目名称:android_bluetooth,代码行数:42,代码来源:hal_lcd.c
示例2: peripheralStateNotificationCB
/*********************************************************************
* @fn peripheralStateNotificationCB
*
* @brief Notification from the profile of a state change.
*
* @param newState - new state
*
* @return none
*/
static void peripheralStateNotificationCB( gaprole_States_t newState )
{
switch ( newState )
{
case GAPROLE_STARTED:
{
uint8 ownAddress[B_ADDR_LEN];
GAPRole_GetParameter(GAPROLE_BD_ADDR, ownAddress);
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
// Display device address
HalLcdWriteString( bdAddr2Str( ownAddress ), HAL_LCD_LINE_2 );
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
}
break;
case GAPROLE_ADVERTISING:
{
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
}
break;
case GAPROLE_WAITING:
{
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
}
break;
case GAPROLE_ERROR:
{
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
}
break;
default:
{
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
}
break;
}
}
开发者ID:karthikdash,项目名称:BLE,代码行数:60,代码来源:simpleBLECentralBroadcaster.c
示例3: pulseAfMsgRx
/**************************************************************************************************
* @fn pulseAfMsgRx
*
* @brief This function is called by pulseSysEvtMsg() to process an incoming AF message.
*
* input parameters
*
* @param msg - A pointer to the afIncomingMSGPacket_t packet.
*
* output parameters
*
* None.
*
* @return None.
**************************************************************************************************
*/
static void pulseAfMsgRx(afIncomingMSGPacket_t *msg)
{
uint8 *buf = msg->cmd.Data;
if(PanEstablishedwithRouter == FALSE & devState == DEV_ZB_COORD){
if(zap_set_logicalType(ZG_DEVICETYPE_ROUTER)){
HalLcdWriteString("Should be Router",HAL_LCD_LINE_7);
}
PanEstablishedwithRouter = TRUE;
if (ZSuccess != osal_start_timerEx(pulseTaskId, PULSE_EVT_ANN, PULSE_DLY_ANN))
{
(void)osal_set_event(pulseTaskId, PULSE_EVT_ANN);
}
}
else{
switch (buf[PULSE_CMD_IDX])
{
case PULSE_CMD_DAT: //Nodes will send this by default
pulseDataRx(msg);
break;
case PULSE_CMD_BEG:
if (INVALID_NODE_ADDR == pulseAddr)
{
NLME_SetPollRate(0);
if(PulseEvtDat_sync == FALSE){
(void)osal_set_event(pulseTaskId, PULSE_EVT_DAT); //Sync Pulsedat event operation
}
}
pulseAddr = msg->srcAddr.addr.shortAddr; // BUILD_UINT16(buf[PULSE_ADR_LSB], buf[PULSE_ADR_MSB]);
break;
case PULSE_CMD_END:
NLME_SetPollRate(POLL_RATE);
pulseAddr = INVALID_NODE_ADDR;
break;
case PULSE_CMD_DAT_TEST: //This is used for testing different payload sizes. Not used in normal operation
pulseTestingDataRx(msg);
break;
default:
break;
}
} //end else
}
开发者ID:MobileHealthMonitoringSystem,项目名称:MHMS,代码行数:66,代码来源:tvsa.c
示例4: zclSampleSw_Init
/*********************************************************************
* @fn zclSampleSw_Init
*
* @brief Initialization function for the zclGeneral layer.
*
* @param none
*
* @return none
*/
void zclSampleSw_Init( byte task_id )
{
zclSampleSw_TaskID = task_id;
#ifdef ZCL_ON_OFF
// Set destination address to indirect
zclSampleSw_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
zclSampleSw_DstAddr.endPoint = 0;
zclSampleSw_DstAddr.addr.shortAddr = 0;
#endif
// This app is part of the Home Automation Profile
zclHA_Init( &zclSampleSw_SimpleDesc );
// Register the ZCL General Cluster Library callback functions
zclGeneral_RegisterCmdCallbacks( SAMPLESW_ENDPOINT, &zclSampleSw_CmdCallbacks );
// Register the application's attribute list
zcl_registerAttrList( SAMPLESW_ENDPOINT, SAMPLESW_MAX_ATTRIBUTES, zclSampleSw_Attrs );
// Register the Application to receive the unprocessed Foundation command/response messages
zcl_registerForMsg( zclSampleSw_TaskID );
#ifdef ZCL_EZMODE
// Register EZ-Mode
zcl_RegisterEZMode( &zclSampleSw_RegisterEZModeData );
// Register with the ZDO to receive Match Descriptor Responses
ZDO_RegisterForZDOMsg(task_id, Match_Desc_rsp);
#endif
// Register for all key events - This app will handle all key events
RegisterForKeys( zclSampleSw_TaskID );
// Register for a test endpoint
afRegister( &sampleSw_TestEp );
ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, End_Device_Bind_rsp );
ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, Match_Desc_rsp );
#ifdef LCD_SUPPORTED
HalLcdWriteString ( (char *)sDeviceName, HAL_LCD_LINE_3 );
#endif
#if defined (OTA_CLIENT) && (OTA_CLIENT == TRUE)
// Register for callback events from the ZCL OTA
zclOTA_Register(zclSampleSw_TaskID);
#endif
}
开发者ID:LILCMU,项目名称:WRATIOT,代码行数:59,代码来源:zcl_samplesw.c
示例5: dBCommand_Service
// << Wayne >> << dBCmd Service >> ++
void dBCommand_Service(uint8 *pCmd)
{
if(osal_memcmp( pCmd, DBCMD_COMFIRM_TICKET, DBCMD_COMFIRM_TICKET_LEN))
{
repeatCmdSendData("s,et,01,cfm,0005,e",18);
// << Wayne >> << Exchanging Take >> ++
dbExchangeCounter++;
// << Wayne >> << Exchanging Take >> --
UART_SEND_STRING(pCmd,19);
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
HalLcdWriteString( "Confirm", HAL_LCD_LINE_6 );
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
}
else if(osal_memcmp( pCmd, DBCMD_READ_EXCHANGE_NUMBER, DBCMD_READ_EXCHANGE_NUMBER_LEN))
{
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
HalLcdWriteString( "ReadCounter", HAL_LCD_LINE_6 );
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
num2Str_Max4L( &pCmd[12], dbExchangeCounter, 4);
UART_SEND_DEBUG_MSG( pCmd, 18 );
repeatCmdSendData(pCmd,18);
}
}
开发者ID:WayneTung,项目名称:TI-CC254x-BLE,代码行数:24,代码来源:simpleBLEPeripheral.c
示例6: 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
示例7: zb_StartConfirm
/******************************************************************************
* @fn zb_StartConfirm
*
* @brief The zb_StartConfirm callback is called by the ZigBee stack
* after a start request operation completes
*
* @param status - The status of the start operation. Status of
* ZB_SUCCESS indicates the start operation completed
* successfully. Else the status is an error code.
*
* @return none
*/
void zb_StartConfirm( uint8 status )
{
// If the device sucessfully started, change state to running
if ( status == ZB_SUCCESS )
{
// Change application state
appState = APP_START;
// Set LED 1 to indicate that node is operational on the network
HalLedSet( HAL_LED_1, HAL_LED_MODE_ON );
// Update the display
#if defined ( LCD_SUPPORTED )
HalLcdWriteString( "SensorDemo", HAL_LCD_LINE_1 );
HalLcdWriteString( "Sensor", HAL_LCD_LINE_2 );
#endif
// Store parent short address
zb_GetDeviceInfo(ZB_INFO_PARENT_SHORT_ADDR, &parentShortAddr);
// Set event to bind to a collector
osal_set_event( sapi_TaskID, MY_FIND_COLLECTOR_EVT );
}
}
开发者ID:smileboywtu,项目名称:ZigbeeLcdStack,代码行数:36,代码来源:DemoSensor.c
示例8: ipd_PublishPriceCB
/*********************************************************************
* @fn ipd_PublishPriceCB
*
* @brief Callback from the ZCL SE Profile Pricing Cluster Library when
* it received a Publish Price for this application.
*
* @param pCmd - pointer to structure for Publish Price command
* @param srcAddr - source address
* @param seqNum - sequence number for this command
*
* @return none
*/
static void ipd_PublishPriceCB( zclCCPublishPrice_t *pCmd,
afAddrType_t *srcAddr, uint8 seqNum )
{
if ( pCmd )
{
// display Provider ID field
HalLcdWriteString("Provider ID", HAL_LCD_LINE_1);
HalLcdWriteValue( pCmd->providerId, 10, HAL_LCD_LINE_2 );
}
#if defined ( INTER_PAN )
ZMacSetReq( ZMacRxOnIdle, &rxOnIdle ); // set receiver on when idle flag to false
// after getting publish price command via INTER-PAN
#endif
}
开发者ID:junstrix,项目名称:zstack-end-device,代码行数:27,代码来源:ipd.c
示例9: zclSampleSw_LcdDisplayMainMode
/*********************************************************************
* @fn zclSampleSw_LcdDisplayMainMode
*
* @brief Called to display the main screen on the LCD.
*
* @param none
*
* @return none
*/
void zclSampleSw_LcdDisplayMainMode(void)
{
if ( zclSampleSw_NwkState == DEV_ZB_COORD )
{
zclHA_LcdStatusLine1(0);
}
else if ( zclSampleSw_NwkState == DEV_ROUTER )
{
zclHA_LcdStatusLine1(1);
}
else if ( zclSampleSw_NwkState == DEV_END_DEVICE )
{
zclHA_LcdStatusLine1(2);
}
#ifdef LCD_SUPPORTED
if ( ( zclSampleSw_NwkState == DEV_ZB_COORD ) ||
( zclSampleSw_NwkState == DEV_ROUTER ) )
{
// display help key with permit join status
if ( gPermitDuration )
{
HalLcdWriteString("SW5: Help *", HAL_LCD_LINE_3);
}
else
{
HalLcdWriteString("SW5: Help ", HAL_LCD_LINE_3);
}
}
else
{
// display help key
HalLcdWriteString((char *)sSwHelp, HAL_LCD_LINE_3);
}
#endif
}
开发者ID:LILCMU,项目名称:WRATIOT,代码行数:45,代码来源:zcl_samplesw.c
示例10: SerialApp_Init
/*********************************************************************
* @fn SerialApp_Init
*
* @brief This is called during OSAL tasks' initialization.
*
* @param task_id - the Task ID assigned by OSAL.
*
* @return none
*/
void SerialApp_Init( uint8 task_id )
{
halUARTCfg_t uartConfig;
SerialApp_MsgID = 0x00;
SerialApp_SeqRx = 0xC3;
SerialApp_TaskID = task_id;
SerialApp_DstAddr.endPoint = 0;
SerialApp_DstAddr.addr.shortAddr = 0;
SerialApp_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
SerialApp_RspDstAddr.endPoint = 0;
SerialApp_RspDstAddr.addr.shortAddr = 0;
SerialApp_RspDstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
afRegister( (endPointDesc_t *)&SerialApp_epDesc );
RegisterForKeys( task_id );
uartConfig.configured = TRUE; // 2430 don't care.
uartConfig.baudRate = SERIAL_APP_BAUD;
uartConfig.flowControl = TRUE;
uartConfig.flowControlThreshold = SERIAL_APP_THRESH;
uartConfig.rx.maxBufSize = SERIAL_APP_RX_MAX;
uartConfig.tx.maxBufSize = SERIAL_APP_TX_MAX;
uartConfig.idleTimeout = SERIAL_APP_IDLE; // 2430 don't care.
uartConfig.intEnable = TRUE; // 2430 don't care.
#if SERIAL_APP_LOOPBACK
uartConfig.callBackFunc = rxCB_Loopback;
#else
uartConfig.callBackFunc = rxCB;
#endif
HalUARTOpen (SERIAL_APP_PORT, &uartConfig);
#if defined ( LCD_SUPPORTED )
HalLcdWriteString( "SerialApp2", HAL_LCD_LINE_2 );
#endif
HalLedSet(HAL_LED_1,HAL_LED_MODE_OFF);
HalLedSet(HAL_LED_2,HAL_LED_MODE_OFF);
HalLedSet(HAL_LED_3,HAL_LED_MODE_OFF);
ZDO_RegisterForZDOMsg( SerialApp_TaskID, End_Device_Bind_rsp );
ZDO_RegisterForZDOMsg( SerialApp_TaskID, Match_Desc_rsp );
osal_start_timerEx(SerialApp_TaskID,SERIALAPP_MSG_AUTOMATCH,2000);
}
开发者ID:kricnam,项目名称:blackboxreader,代码行数:57,代码来源:SerialApp.c
示例11: GenericApp_Init
/*********************************************************************
* @fn GenericApp_Init
*
* @brief Initialization function for the Generic 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 GenericApp_Init( byte task_id )
{
GenericApp_TaskID = task_id;
GenericApp_NwkState = DEV_INIT;
GenericApp_TransID = 0;
// Device hardware initialization can be added here or in main() (Zmain.c).
// If the hardware is application specific - add it here.
// If the hardware is other parts of the device add it in main().
GenericApp_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
GenericApp_DstAddr.endPoint = 0;
GenericApp_DstAddr.addr.shortAddr = 0;
// Fill out the endpoint description.
GenericApp_epDesc.endPoint = GENERICAPP_ENDPOINT;
GenericApp_epDesc.task_id = &GenericApp_TaskID;
GenericApp_epDesc.simpleDesc
= (SimpleDescriptionFormat_t *)&GenericApp_SimpleDesc;
GenericApp_epDesc.latencyReq = noLatencyReqs;
// Register the endpoint description with the AF
afRegister( &GenericApp_epDesc );
// Register for all key events - This app will handle all key events
RegisterForKeys( GenericApp_TaskID );
// Update the display
#if defined ( LCD_SUPPORTED )
HalLcdWriteString( "GenericApp", HAL_LCD_LINE_1 );
#endif
ZDO_RegisterForZDOMsg( GenericApp_TaskID, End_Device_Bind_rsp );
ZDO_RegisterForZDOMsg( GenericApp_TaskID, Match_Desc_rsp );
ZDO_RegisterForZDOMsg( GenericApp_TaskID, SPI_INCOMING_ZAPP_DATA );
/*****for SHP *************begin******************/{
//extern void shp_example_init_called_by_system(void);
//shp_example_init_called_by_system();
/*****for SHP *************end********************/}
//QBing
MT_UartRegisterTaskID(GenericApp_TaskID);
MT_UartZAppBufferLengthRegister(100);
osal_start_timerEx(GenericApp_TaskID,GENERICAPP_TIMER_EVT,1000);
}
开发者ID:qbing,项目名称:SmartHome,代码行数:60,代码来源:GenericApp.c
示例12: ipd_DisplayMessageCB
/*********************************************************************
* @fn ipd_DisplayMessageCB
*
* @brief Callback from the ZCL SE Profile Message Cluster Library when
* it received a Display Message Command for
* this application.
*
* @param pCmd - pointer to structure for Display Message command
* @param srcAddr - source address
* @param seqNum - sequence number for this command
*
* @return none
*/
static void ipd_DisplayMessageCB( zclCCDisplayMessage_t *pCmd,
afAddrType_t *srcAddr, uint8 seqNum )
{
// Upon receipt of the Display Message Command, the device shall
// display the message. If the Message Confirmation bit indicates
// the message originator require a confirmation of receipt from
// a Utility Customer, the device should display the message or
// alert the user until it is either confirmed via a button or by
// selecting a confirmation option on the device. Confirmation is
// typically used when the Utility is sending down information
// such as a disconnection notice, or prepaid billing information.
// Message duration is ignored when confirmation is requested and
// the message is displayed until confirmed.
#if defined ( LCD_SUPPORTED )
HalLcdWriteString( (char*)pCmd->msgString.pStr, HAL_LCD_LINE_3 );
#endif // LCD_SUPPORTED
}
开发者ID:junstrix,项目名称:zstack-end-device,代码行数:31,代码来源:ipd.c
示例13: simpleBLEPeripheral_HandleKeys
static void simpleBLEPeripheral_HandleKeys(uint8 shift, uint8 keys) {
if (keys & HAL_KEY_UP) {
u_state = IR_DATA_STUDY_CMD_START_BEGIN_STATE;
SbpHalUARTWrite(&SBP_UART_STUDY_CMD, SBP_UART_STUDY_CMD_LEN);
}
if (keys & HAL_KEY_LEFT) {
}
if (keys & HAL_KEY_DOWN) {
HalLcdWriteString("send after 3s...", HAL_LCD_LINE_4);
osal_start_timerEx(simpleBLEPeripheral_TaskID, SBP_SEND_IRDATA_EVT, 3000);
}
if (keys & HAL_KEY_RIGHT) {
HalLcdWriteStringValue("data_len:", data_len, 10, HAL_LCD_LINE_2);
}
}
开发者ID:jpwl88,项目名称:BLE-CC254x-1.3.2,代码行数:19,代码来源:simpleBLEPeripheral.c
示例14: sendUartMessage
/**
* @brief Envía un mensaje por UART según el protocolo implementado. Este se
* crea a partir de un mensaje y otros datos (genéricos) pasados como
* argumento. Para el mensaje de tipo REPORT, los otros datos
* corresponden a los flags de alarmas, y son añadidos al mensaje antes
* de los parámetros eléctricos.
* Los mensajes tienen el siguiente formato:
* HEADER DATA
* SOF | DATA LENGTH | COMMAND | SENSOR MAC | DATA[DATA LENGTH]
* Donde SOF=0xFE es el delimitador del inicio del frame; DATA LENGTH
* es la cantidad de bytes de datos envíados luego del HEADER; COMMAND
* es el comando enviado a la PC (REPORT, etc.); SENSOR MAC es la
* dirección MAC de 64 bytes del nodo al cual se refiere la información;
* y DATA corresponde a los datos enviados en formato Little Endian.
*
* @param msg Mensaje que se desea retransmitir por UART.
* @param other Otros datos para añadir al mensaje.
*/
static void sendUartMessage(struct message_t *msg, void *other)
{
uint8 pFrame[UART_FRAME_MAX_LENGTH];
// start of frame
pFrame[UART_FRAME_SOF_OFFSET] = CPT_SOP;
// tipo de mensaje
pFrame[UART_FRAME_CMD_OFFSET] = msg->msgType;
// MAC
memcpy(&(pFrame[UART_FRAME_MAC_OFFSET]), &(msg->mac), sizeof(msg->mac));
if (msg->msgType == MSG_TYPE_REPORT)
{
// length
pFrame[UART_FRAME_LENGTH_OFFSET] = UART_FRAME_REPORT_LENGTH;
// secuencia
pFrame[UART_FRAME_DATA_OFFSET] = LO_UINT16(msg->sequence);
pFrame[UART_FRAME_DATA_OFFSET+1] = HI_UINT16(msg->sequence);
// flags alarmas
uint16 flags = *((uint16*)other);
pFrame[UART_FRAME_DATA_OFFSET+2] = LO_UINT16(flags);
pFrame[UART_FRAME_DATA_OFFSET+3] = HI_UINT16(flags);
// parámetros eléctricos
memcpy(&(pFrame[UART_FRAME_DATA_OFFSET+4]), &(msg->data), msg->lenData);
}
else
{
// otros tipos de mensaje
pFrame[UART_FRAME_LENGTH_OFFSET] = 0;
}
// escribe mensaje en UART
uint16 b = HalUARTWrite(HAL_UART_PORT_0, pFrame,
UART_FRAME_HEADER_LENGTH+pFrame[UART_FRAME_LENGTH_OFFSET]);
if (b > 0)
HalLcdWriteStringValue("UART", b, 10, 3);
else
HalLcdWriteString("", HAL_LCD_LINE_3);
}
开发者ID:arguelles-manuel,项目名称:smartmeter,代码行数:58,代码来源:collector.c
示例15: zclSampleTemperatureSensor_Init
/*********************************************************************
* @fn zclSampleTemperatureSensor_Init
*
* @brief Initialization function for the zclGeneral layer.
*
* @param none
*
* @return none
*/
void zclSampleTemperatureSensor_Init( byte task_id )
{
zclSampleTemperatureSensor_TaskID = task_id;
// Set destination address to indirect
zclSampleTemperatureSensor_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
zclSampleTemperatureSensor_DstAddr.endPoint = 0;
zclSampleTemperatureSensor_DstAddr.addr.shortAddr = 0;
// This app is part of the Home Automation Profile
zclHA_Init( &zclSampleTemperatureSensor_SimpleDesc );
// Register the ZCL General Cluster Library callback functions
zclGeneral_RegisterCmdCallbacks( SAMPLETEMPERATURESENSOR_ENDPOINT, &zclSampleTemperatureSensor_CmdCallbacks );
// Register the application's attribute list
zcl_registerAttrList( SAMPLETEMPERATURESENSOR_ENDPOINT, SAMPLETEMPERATURESENSOR_MAX_ATTRIBUTES, zclSampleTemperatureSensor_Attrs );
// Register the Application to receive the unprocessed Foundation command/response messages
zcl_registerForMsg( zclSampleTemperatureSensor_TaskID );
#ifdef ZCL_EZMODE
// Register EZ-Mode
zcl_RegisterEZMode( &zclSampleTemperatureSensor_RegisterEZModeData );
// Register with the ZDO to receive Match Descriptor Responses
ZDO_RegisterForZDOMsg(task_id, Match_Desc_rsp);
#endif
// Register for all key events - This app will handle all key events
RegisterForKeys( zclSampleTemperatureSensor_TaskID );
// Register for a test endpoint
afRegister( &sampleTemperatureSensor_TestEp );
#ifdef LCD_SUPPORTED
// display the device name
HalLcdWriteString( (char *)sDeviceName, HAL_LCD_LINE_3 );
#endif
}
开发者ID:niuniu500w,项目名称:led_gprs,代码行数:49,代码来源:zcl_sampletemperaturesensor.c
示例16: GenericApp_Init
/*********************************************************************
* @fn GenericApp_Init
*
* @brief Initialization function for the Generic 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 GenericApp_Init( uint8 task_id )
{
GenericApp_TaskID = task_id;
GenericApp_NwkState = DEV_INIT;
GenericApp_TransID = 0;
// Device hardware initialization can be added here or in main() (Zmain.c).
// If the hardware is application specific - add it here.
// If the hardware is other parts of the device add it in main().
GenericApp_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
GenericApp_DstAddr.endPoint = 2;
GenericApp_DstAddr.addr.shortAddr = 0x0000;
// Fill out the endpoint description.
GenericApp_epDesc.endPoint = GENERICAPP_ENDPOINT;
GenericApp_epDesc.task_id = &GenericApp_TaskID;
GenericApp_epDesc.simpleDesc
= (SimpleDescriptionFormat_t *)&GenericApp_SimpleDesc;
GenericApp_epDesc.latencyReq = noLatencyReqs;
// Register the endpoint description with the AF
afRegister( &GenericApp_epDesc );
// Register for all key events - This app will handle all key events
RegisterForKeys( GenericApp_TaskID );
// Update the display
#if defined ( LCD_SUPPORTED )
HalLcdWriteString( "GenericApp", HAL_LCD_LINE_1 );
#endif
ZDO_RegisterForZDOMsg( GenericApp_TaskID, End_Device_Bind_rsp );
ZDO_RegisterForZDOMsg( GenericApp_TaskID, Match_Desc_rsp );
#if defined( IAR_ARMCM3_LM )
// Register this task with RTOS task initiator
RTOS_RegisterApp( task_id, GENERICAPP_RTOS_MSG_EVT );
#endif
}
开发者ID:FanHongchuang,项目名称:ZigbeeToCoolpy,代码行数:54,代码来源:GenericApp.c
示例17: ParkWay_Init
//Initialization function for the Park Way task. This is called during initialization and should contain any application specific initialization (ie. hardware initialization/setup, table initialization, power up notificaiton ... )
void ParkWay_Init( uint8 task_id )
{
ParkWay_TaskID = task_id;
ParkWay_NwkState = DEV_INIT;
ParkWay_TransID = 0;
// Device hardware initialization can be added here or in main() (Zmain.c).
// If the hardware is application specific - add it here.
// If the hardware is other parts of the device add it in main().
ParkWay_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
ParkWay_DstAddr.endPoint = 0;
ParkWay_DstAddr.addr.shortAddr = 0;
// Fill out the endpoint description.
ParkWay_epDesc.endPoint = ParkWay_ENDPOINT;
ParkWay_epDesc.task_id = &ParkWay_TaskID;
ParkWay_epDesc.simpleDesc
= (SimpleDescriptionFormat_t *)&ParkWay_SimpleDesc;
ParkWay_epDesc.latencyReq = noLatencyReqs;
// Register the endpoint description with the AF
afRegister( &ParkWay_epDesc );
// Register for all key events - This app will handle all key events
RegisterForKeys( ParkWay_TaskID );
// Update the display
#if defined ( LCD_SUPPORTED )
HalLcdWriteString( "ParkWay-Coord", HAL_LCD_LINE_1 );
#endif
ZDO_RegisterForZDOMsg( ParkWay_TaskID, End_Device_Bind_rsp );
ZDO_RegisterForZDOMsg( ParkWay_TaskID, Match_Desc_rsp );
osal_start_timerEx( ParkWay_TaskID,
POLL_PARWAY_EVT,
TIME_PARKWAY_POLL);
}
开发者ID:aignacio,项目名称:Smartbee-Network-,代码行数:40,代码来源:PW_Coordinator.c
示例18: zclHA_LcdStatusLine1
/*********************************************************************
* @fn zclHA_LcdStatusLine1
*
* @brief Display LCD line 1 with network status
* only call after on network
* ZC: PPPP CH ADDR
* ZR: PPPP CH ADDR
* ZE: PPPP CH ADDR
*
* @param kind (0=ZC, 1=ZR, 2=ZED)
*
* @return none
*/
void zclHA_LcdStatusLine1( uint8 kind )
{
#if defined ( LCD_SUPPORTED )
char szLine[20];
// copy in what node type it is
if ( kind > ZCL_HA_DEVICE_END_DEVICE )
{
return;
}
// ZE: PANx CH ADDR
osal_memcpy( szLine, NwkInfoStrs[kind], 4 );
zclHA_uint16toa( _NIB.nwkPanId, &szLine[4] );
szLine[8] = ' ';
_ltoa( _NIB.nwkLogicalChannel, (void *)(&szLine[9]), 10 );
szLine[11] = ' ';
zclHA_uint16toa( _NIB.nwkDevAddress, &szLine[12] );
HalLcdWriteString( (char*)szLine, HAL_LCD_LINE_1 );
#endif
}
开发者ID:paoloach,项目名称:zpowermeter,代码行数:36,代码来源:zcl_ha.c
示例19: SampleApp_Init
//.........这里部分代码省略.........
P0DIR &= ~0x01; //P00输入echo
trig=0;
/*定时器配置*/
HalTimerInit();
HalTimerConfig(HAL_TIMER_0,
HAL_TIMER_MODE_CTC,
HAL_TIMER_CHANNEL_SINGLE,
HAL_TIMER_CH_MODE_OUTPUT_COMPARE,
TRUE,
timer_callback);
/***********步进电机**************/
#define in1 P0_4
#define in2 P0_5
#define in3 P0_6
#define in4 P0_7
P0SEL &=~0xf0;
P0DIR |= 0xf0;
P0INP &=~0Xf0; //打开上拉
in1=0;
in2=0;
in3=0;
in4=0;
/*测试*/
int i=0;
for(i=0;i<128;i++)
{
MotorCW();
}
for(i=0;i<128;i++)
{
MotorCCW();
}
HalLedBlink( HAL_LED_2, 2,50, 500);
#endif
// Device hardware initialization can be added here or in main() (Zmain.c).
// If the hardware is application specific - add it here.
// If the hardware is other parts of the device add it in main().
#if defined ( BUILD_ALL_DEVICES )
// The "Demo" target is setup to have BUILD_ALL_DEVICES and HOLD_AUTO_START
// We are looking at a jumper (defined in SampleAppHw.c) to be jumpered
// together - if they are - we will start up a coordinator. Otherwise,
// the device will start as a router.
if ( readCoordinatorJumper() )
zgDeviceLogicalType = ZG_DEVICETYPE_COORDINATOR;
else
zgDeviceLogicalType = ZG_DEVICETYPE_ROUTER;
#endif // BUILD_ALL_DEVICES
#if defined ( HOLD_AUTO_START )
// HOLD_AUTO_START is a compile option that will surpress ZDApp
// from starting the device and wait for the application to
// start the device.
ZDOInitDevice(0);
#endif
// Setup for the periodic message's destination address
// Broadcast to everyone
SampleApp_Periodic_DstAddr.addrMode = (afAddrMode_t)AddrBroadcast;
SampleApp_Periodic_DstAddr.endPoint = SAMPLEAPP_ENDPOINT;
SampleApp_Periodic_DstAddr.addr.shortAddr = 0xFFFF;
// Setup for the flash command's destination address - Group 1
SampleApp_Flash_DstAddr.addrMode = (afAddrMode_t)afAddrGroup;
SampleApp_Flash_DstAddr.endPoint = SAMPLEAPP_ENDPOINT;
SampleApp_Flash_DstAddr.addr.shortAddr = SAMPLEAPP_FLASH_GROUP;
// 网蜂点对点通讯定义
Point_To_Point_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;//点播
Point_To_Point_DstAddr.endPoint = SAMPLEAPP_ENDPOINT;
Point_To_Point_DstAddr.addr.shortAddr = 0x0000; //发给协调器
// Fill out the endpoint description.
SampleApp_epDesc.endPoint = SAMPLEAPP_ENDPOINT;
SampleApp_epDesc.task_id = &SampleApp_TaskID;
SampleApp_epDesc.simpleDesc
= (SimpleDescriptionFormat_t *)&SampleApp_SimpleDesc;
SampleApp_epDesc.latencyReq = noLatencyReqs;
// Register the endpoint description with the AF
afRegister( &SampleApp_epDesc );
// Register for all key events - This app will handle all key events
RegisterForKeys( SampleApp_TaskID );
// By default, all devices start out in Group 1
SampleApp_Group.ID = 0x0001;
osal_memcpy( SampleApp_Group.name, "Group 1", 7 );
aps_AddGroup( SAMPLEAPP_ENDPOINT, &SampleApp_Group );
#if defined ( LCD_SUPPORTED )
HalLcdWriteString( "SmartPark", HAL_LCD_LINE_1 );
#endif
}
开发者ID:bursto7,项目名称:Zigbee-for-Wechatpark-Opendoor,代码行数:101,代码来源:SampleApp.c
示例20: HalLcdWriteString
/**************************************************************************************************
z-stack代码,未修改
**************************************************************************************************/
void HalLcdWriteString ( char *str, uint8 option)
{
#ifdef LCD_TO_UART
NPI_WriteTransport ( (uint8*)str,osal_strlen(str));
NPI_WriteTransport ("\r\n",2);
#endif
#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)
#if defined(SERIAL_DEBUG_SUPPORTED)
debug_str( (uint8*)buf );
#endif //LCD_SUPPORTED
#endif //ZTOOL_P1
/* Free mem */
osal_mem_free( buf );
}
}
/* Display the string */
HalLcd_HW_WriteLine (option, str);
#endif //HAL_LCD
}
开发者ID:JCJohnbee,项目名称:Johnbee_Repository,代码行数:70,代码来源:hal_lcd.c
注:本文中的HalLcdWriteString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论