資源簡介
(包含組網.發送數據.接收數據.COAP.UDP).所有功能都已經做好了.針對適用于STM8的芯片.其他的芯片.需要把底層的接口修改下.流程都是OK的

代碼片段和文件信息
/*
********************************************************************************
*
*?????????????????????????????????Drivers_BC95.c
*
*?File??????????:?Drivers_BC95.c
*?Version???????:?V1.0
*?Author????????:?Lhl
*?Mode??????????:?Thumb2
*?Toolchain?????:?
*?Description???:?BC95驅動程序
*????????????????
*?History???????:
*?Date??????????:?2018.10.15
*******************************************************************************/
#include???//
#include????//
#include???//va_listva_startva_end
#include??//bool變量在此庫中
#include???//atoi函數在此庫中(ASCII?TO?Integer)
#include?“BSP_Uart.h“
#include?“Queue.h“
#include?“Delay.h“
#include?“Drivers_BC95.h“
BC95_GPIO_TypeDef?G_NB_BC95_CFG;
QUEUE8_t?G_BC95ATRx_Queue?=?{0};
QUEUE8_t?G_BC95DataRx_Queue?=?{0};
static?char?G_NBATBuffter[G_NBBuffterSize]?=?{0};
static?char?G_NBDataBuffer[G_NBBuffterSize]?=?{0};
INTERRUPT_HANDLER(TIM3_CC_USART3_RX_IRQHandler?22)
{
????/*?In?order?to?detect?unexpected?events?during?development
???????it?is?recommended?to?set?a?breakpoint?on?the?following?instruction.
????*/
????static?char?m_NB_Buffer[G_NBBuffterSize]?=?{0};
????static?int?i?=?0;
????volatile?unsigned?char?clear;
????if?(USART_GetITStatus(USART3?USART_IT_RXNE)?!=?RESET)
????{
????????uint8_t?ch?=?USART3->DR;
????????m_NB_Buffer[i++]?=?ch;
????}
????else?if?(USART_GetITStatus(USART3?USART_IT_IDLE)?!=?RESET)
????{
????????clear?=?USART3->SR;
????????clear?=?USART3->DR;
????????QUEUE_PacketIn(&G_BC95ATRx_Queue?(uint8_t?*)m_NB_Buffer?i);
????????if?(NULL?!=?strstr(m_NB_Buffer?“+NNMI:“))?//接收到來自于COAP平臺端的數據
????????{
????????????QUEUE_PacketIn(&G_BC95DataRx_Queue?(uint8_t?*)m_NB_Buffer?i);
????????}
????????memset(m_NB_Buffer?0?i);
????????i?=?0;
????}
}
/*******************************************************************************
*?Function?Name?:?int?Drivers_BC95_ReadCommandData(char?*Buf)
*?Description???:?BC95?AT?Command?Ack?Read?
*?Author????????:?Lhl
*?Input?????????:?
*?Output????????:?return?Receive?AT?Command?Data?Lenth
*?Other?????????:
*?Date??????????:?2018.10.15
*******************************************************************************/
int?Drivers_BC95_ReadCommandData(char?*Buf)
{
????int?len?=?0;
????len?=?QUEUE_PacketOut(&G_BC95ATRx_Queue?(uint8_t?*)Buf?G_NBBuffterSize);
????memset(G_NBATBuffter?0?G_NBBuffterSize);
????return?len;
}
/*******************************************************************************
*?Function?Name?:?int?Drivers_BC95_ReadData(char?*Buf)
*?Description???:?BC95?Data?Receive?(For?COAP)
*?Author????????:?Lhl
*?Input?????????:?
*?Output????????:?return?Receive?Data?Lenth
*?Other?????????:
*?Date??????????:?2018.10.15
*******************************************************************************/
int?Drivers_BC95_ReadData(char?*Buf)
{
????char?m_NBDataBufPart[150]?=?{0};
????char?m_NBDataBufPart1[15]?=?{0};
????int?m_NBDataSize?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????179714??2018-10-17?09:57??BC95\BC95模組使用手冊.pdf
?????文件??????24343??2018-10-17?09:54??BC95\Drivers_BC95.c
?????文件???????3738??2018-10-17?09:52??BC95\Drivers_BC95.h
?????目錄??????????0??2018-10-17?09:54??BC95
-----------?---------??----------?-----??----
???????????????207795????????????????????4
評論
共有 條評論