飞利浦双串口51单片机485网关

2023-10-31 14:01

本文主要是介绍飞利浦双串口51单片机485网关,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

主要功能将PC端的数据接收下来,分发到不同的设备,也是轮询设备数据读取回来,打包回传到PC端,数据包包头包尾识别,数据校验,接收超时处理,将协议结构化处理,协议的改动不需要改动程序,中断接收一帧完成置标志位交由上层协议程序校验并处理转发

协议格式定义,每一个位都进行了定仪

#ifndef PROTOCOL_H
#define PROTOCOL_H
#include "define.h"
//IO_EMM_31
typedef struct 
{uchar Stx;uchar Length;uchar ID;uchar TollCollectorID[3];uchar LoginDuration[2];uchar VehicleClass;union{uchar byte;struct{uchar Payment:4;uchar Axle:4;}BIT;}AxlePaymentDisplay;union{uint word;uchar byte[2];}TollFare;union{uchar byte;struct{			uchar reserved:1;uchar Exit_LSS_Rlight:1;uchar BarrierClose:1;uchar BarrierOpen:1;uchar Entry_LSS_Rlight:1;uchar Entry_LSS_Glight:1;uchar LaneLog:1;uchar zero:1;}BIT;}TMU_Control1;union{uchar byte;struct{uchar EmergencyAlarm:1;uchar EvasionAlarm:1;uchar DiscrepancyAlarm:1;uchar MisregistrationAlarm:1;uchar reserved:1;uchar AxleDectorFault:1;uchar BoothEquipmentFault:1;uchar zero:1;}BIT;}TMU_Control2;union{uchar byte;struct{uchar EmergencyAlarmRstBut:1;uchar EvalsionAlarmRstBut:1;uchar DiscrepancyAlarmRstBut:1;uchar MisregistrationAlarmRstBut:1;uchar AxleDetectorOVerride:1;uchar KeyInOverrideSelect:1;uchar reserved:1;uchar zero:1;}BIT;}ConStatus1;union{uchar byte;struct{uchar resetved:4;uchar TMUCommFail:1;uchar TMUDimmerOverAct:1;uchar AllSignageDimmming:1;uchar zero:1;}BIT;}ConStatus2;union{uchar byte;struct{uchar reserved:1;uchar CanopyBeacon:1;uchar Entry_LSS_Rlight:1;uchar Entry_LSS_Glight:1;uchar TPS_Glight:1;uchar TPS_Rlight:1;uchar DimmingNormal:1;uchar zero:1;}BIT;}SignageControl;union{uchar byte;struct{uchar TPSCommFail:1;uchar reserve2:1;uchar reserve1:1;uchar TPSTempHigher70:1;uchar CLSCommFail:1;uchar CLSPixelFaultDetect:1;uchar CLSTempHigher70:1;uchar zero:1;}BIT;}TPS_CLSFaultStatus;union{uchar byte;struct{uchar EntryCommFail:1;uchar ExitCommFail:1;uchar RlightAspectHigher50:1;uchar RlightAspectHigher25:1;uchar TempHigher70:1;uchar reseved:1;uchar Rlight:1;uchar zero:1;}BIT;}ExitLSSStatus;union{uchar byte;struct{uchar GlightAspectHigher50:1;uchar GlightAspectHigher25:1;uchar RlightAspectHigher50:1;uchar RlightAspectHigher25:1;uchar TempHigher70:1;uchar Glight:1;uchar Rlight:1;uchar zero:1;}BIT;}EntryLSSStatus;union{uchar byte;struct{uchar ShortDetect:1;uchar reserved:2;uchar KickBarAlarm:1;uchar CabinetOpen:1;uchar BarrierColse:1;uchar BarrierOpen:1;uchar zero:1;}BIT;}LocalIOInputStatus;union{uchar byte;struct{uchar Class0:1;uchar Class1:1;uchar Class2:1;uchar Class3:1;uchar Class4:1;uchar Class5:1;uchar Class6:1;uchar zero:1;}BIT;}AutoTollInputStatus1;union{uchar byte;struct{uchar Class7:1;uchar Class8:1;uchar Class9:1;uchar ClassAdd1:1;uchar LaneOpen:1;uchar LaneClose:1;uchar reserved:1;uchar zero:1;}BIT;}AutoTollInputStatus2;union{uchar byte;struct{uchar Axle1:1;uchar Axle2:1;uchar Axle3:1;uchar Axle4:1;uchar Axle5:1;uchar Axle6:1;uchar reserved:1;uchar zero:1;}BIT;}AutoTollInputStatus3;uchar Checksum;uchar Etx;
}IO_EMM_31;//IO_EMM_32
typedef struct
{uchar Stx;uchar Length;uchar ID;union{uchar byte;struct{uchar reserved:1;uchar Dimmer:3;uchar Normal:3;uchar zero:1;}BIT;}TPSSetting;union{uchar byte;struct{uchar reserved:1;uchar Dimmer:3;uchar Normal:3;uchar zero:1;}BIT;}CLSSetting;union{uchar byte;struct{uchar reserved:1;uchar Dimmer:3;uchar Normal:3;uchar zero:1;}BIT;}EntryLSSSetting;union{uchar byte;struct{uchar reserved:1;uchar Dimmer:3;uchar Normal:3;uchar Zero:1;}BIT;}ExitLSSSetting;uchar Checksum;uchar Etx;
}IO_EMM_32;//IO_TMU
typedef struct
{uchar Stx;uchar Length;uchar ID;uchar TollCollectorID[3];uchar LoginDuration[2];uchar VehicleClass;union{uchar byte;struct{uchar Payment:4;uchar Axle:4;}BIT;}AxlePaymentDisplay;union{uchar byte;struct{			uchar reserved:1;uchar Exit_LSS_Rlight:1;uchar BarrierClose:1;uchar BarrierOpen:1;uchar Entry_LSS_Rlight:1;uchar Entry_LSS_Glight:1;uchar LaneLog:1;uchar zero:1;}BIT;}TMU_Control1;union{uchar byte;struct{uchar EmergencyAlarm:1;uchar EvasionAlarm:1;uchar DiscrepancyAlarm:1;uchar MisregistrationAlarm:1;uchar reserved:1;uchar AxleDectorFault:1;uchar BoothEquipmentFault:1;uchar zero:1;}BIT;}TMU_Control2;union{uchar byte;struct{uchar EmergencyAlarmRstBut:1;uchar EvalsionAlarmRstBut:1;uchar DiscrepancyAlarmRstBut:1;uchar MisregistrationAlarmRstBut:1;uchar AxleDetectorOVerride:1;uchar KeyInOverrideSelect:1;uchar reserved:1;uchar zero:1;}BIT;}ConStatus1;union{uchar byte;struct{uchar resetved:5;uchar TMUDimmerOverAct:1;uchar AllSignageDimming:1;uchar zero:1;}BIT;}ConStatus2;uchar Checksum;uchar Etx;
}IO_TMU;//IO_TPS
typedef struct
{uchar Stx;uchar Length;uchar ID;union{uint word;uchar byte[2];}TollFare;union{uchar byte;struct{uchar DispPleasePaid:1;uchar DispThankyou:1;uchar Rlight:1;uchar Glight:1;uchar BrightnessControl:3;uchar reserved:1;}BIT;}LedDisplay;union{uchar byte;struct{uchar TempHigher70:1;uchar reserved:7;}BIT;}Status;uchar Checksum;uchar Etx;
}IO_TPS;//IO_CLS
typedef struct
{uchar Stx;uchar Length;uchar ID;uchar VehicleClass;union{uchar byte;struct{uchar Axle:3;uchar reserved1:1;uchar RelayContactClose:1;uchar reserved2:3;}BIT;}AxleCounterDisplay;union{uchar byte;struct{uchar reserved:4;uchar Brightness:3;uchar zero:1;}BIT;}BrightnessControl;union{uchar byte;struct{uchar TempHigher70:1;uchar PixelFaultDetected:1;uchar reserved:6;}BIT;}Status;uchar Checksum;uchar Etx;
}IO_CLS;//IO_LSS
typedef struct
{uchar Stx;uchar Length;uchar ID;union{uchar byte;struct{uchar Rlight:1;uchar Glight:1;uchar reserved:6;			}BIT;}SignalDisp;union{uchar byte;struct{uchar RlightAspectHigher25:1;uchar RlightAspectHigher50:1;uchar GlightAspectHigher25:1;uchar GlightAspectHigher50:1;uchar BrightnessControl:3;uchar reserved:1;			}BIT;}Status1;union{uchar byte;struct{uchar TempHigher70:1;uchar reserved:7;}BIT;}Status2;uchar Checksum;uchar Etx;
}IO_LSS;typedef struct
{uchar Dimmer;uchar Normal;
}BRIGHTNESS;
#endif

中断接收与发送

void IntUart0Rx( void ) interrupt 4
{uchar temp;static uchar MsgLen;if( RI_0 ){RI_0 = 0;temp = S0BUF;Timer1ms[TIMER_COM_DEV].Tick = 10;Timer1ms[TIMER_COM_DEV].Flg.BIT.Enable = 1;Timer[TIMER_RESPONSE].Tick = 5;ACC = temp;if( P==RB8_0 ){if( !DevStrEndFlg ){if( temp==0xaa ){									  DevStrEndFlg = 1;IO2Dev.RecvPtr = 0;IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;IO2Dev.Error.byte = 0;}}else{if( temp==0xab && IO2Dev.RecvPtr==MsgLen ){DevStrEndFlg = 0;IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;IO2Dev.Flg.BIT.Recv = 1;IO2Dev.RecvLen = IO2Dev.RecvPtr;}/*else if( temp==0xaa  && IO2Dev.RecvPtr!=MsgLen-1 ){IO2Dev.RecvPtr = 0;IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;}*/else if( IO2Dev.RecvPtr==2 ){IO2Dev.ID = temp;IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;switch( IO2Dev.ID ){case IO_TMU_ID:MsgLen = sizeof( IO_TMU )-1;break;case IO_TPS_ID:MsgLen = sizeof( IO_TPS )-1;break;case IO_CLS_ID:MsgLen = sizeof( IO_CLS )-1;break;case IO_ELSS_ID:MsgLen = sizeof( IO_LSS )-1;break;case IO_XLSS_ID:MsgLen = sizeof( IO_LSS )-1;break;default:DevStrEndFlg = 0;}}else if( IO2Dev.RecvPtr<RECVBUF_LEN ){IO2Dev.RecvBuf[IO2Dev.RecvPtr++] = temp;}else  //接收数据溢出{DevStrEndFlg = 0;IO2Dev.RecvPtr = 0;}
//				flg = IO2Dev.RecvPtr;}}else{IO2Dev.Error.BIT.Even = 1;}}else if( S0STAT&0x08 )//Framing Error{S0STAT &= ~0x08;IO2Dev.Error.BIT.Framing = 1;}else if( S0STAT&0x04 )//Break Detect{S0STAT &= ~0x04;IO2Dev.Error.BIT.BreakDetect = 1;}else if( S0STAT&0x02 )//Overrun Error{S0STAT &= ~0x02;IO2Dev.Error.BIT.Overrun = 1;}
}//串行口0的发送中断程序
void IntUart0Tx( void ) interrupt 7
{Uart0SendData();
}

以指针提取数据
在这里插入图片描述

#include "Emm2IO.h"
#include "com.h"
#include "protocol.h"
#include "systemtask.h"
#include "IOCheck.h"IO_EMM_31 IOEmm31;
extern BUF_DEF Emm2IO;
extern IO_TMU IOTmu;
extern IO_TPS IOTps;
extern IO_CLS IOCls;
extern IO_LSS IOEntryLss;
extern IO_LSS IOExitLss;
extern BRIGHTNESS TpsBrightness,ClsBrightness,EntryLssBrightness,ExitLssBrightness;extern IO_CHECK_DEF IoCheck;
extern TIMER_DEF Timer[TIMER_NUM];
extern uchar flg;
void Emm2IOInit( void )
{//31IOEmm31.Stx = 0xaa;IOEmm31.Length = 0x18;IOEmm31.ID = 0x20;IOEmm31.ConStatus1.byte = 0;IOEmm31.ConStatus2.byte = 0x10;IOEmm31.TPS_CLSFaultStatus.byte = 0x11;IOEmm31.ExitLSSStatus.byte = 0x03;IOEmm31.EntryLSSStatus.byte = 0x00;IOEmm31.LocalIOInputStatus.byte = 0x00;IOEmm31.AutoTollInputStatus1.byte = 0x00;IOEmm31.AutoTollInputStatus2.byte = 0x00;IOEmm31.AutoTollInputStatus3.byte = 0x00;IOEmm31.Etx = 0xab;Emm2IO.Flg.byte = 0;Emm2IO.SendLen = 0;Emm2IO.RecvLen = 0;Emm2IO.SendPtr = 0;Emm2IO.RecvPtr = 0;Timer[TIMER_STOP].Flg.BIT.TimeOut = 0;Timer[TIMER_STOP].Tick = 500;Timer[TIMER_STOP].Flg.BIT.Enable = 1;
}
//从Emm2IOController31的接收数据中取出需要的内容放到设备缓冲区中
void CopyEmm31ToDev( IO_EMM_31 *IoEmm31Ptr )
{//TMUIOTmu.TollCollectorID[0] = IoEmm31Ptr->TollCollectorID[0];IOTmu.TollCollectorID[1] = IoEmm31Ptr->TollCollectorID[1];IOTmu.TollCollectorID[2] = IoEmm31Ptr->TollCollectorID[2];IOTmu.LoginDuration[0] = IoEmm31Ptr->LoginDuration[0];IOTmu.LoginDuration[1] = IoEmm31Ptr->LoginDuration[1];IOTmu.VehicleClass = IoEmm31Ptr->VehicleClass;IOTmu.AxlePaymentDisplay.byte = IoEmm31Ptr->AxlePaymentDisplay.byte;IOTmu.TMU_Control1.byte = IoEmm31Ptr->TMU_Control1.byte;IOTmu.TMU_Control2.byte = IoEmm31Ptr->TMU_Control2.byte;//TPSIOTps.TollFare.byte[0] = IoEmm31Ptr->TollFare.byte[0];IOTps.TollFare.byte[1] = IoEmm31Ptr->TollFare.byte[1];IOTps.LedDisplay.BIT.Glight = IoEmm31Ptr->SignageControl.BIT.TPS_Glight;IOTps.LedDisplay.BIT.Rlight = IoEmm31Ptr->SignageControl.BIT.TPS_Rlight;if( (((IoEmm31Ptr->TollFare.byte[0]&0xf0)>>4) == 0x000c) && (IoEmm31Ptr->AxlePaymentDisplay.BIT.Payment == 0x0b) ){IOTps.LedDisplay.BIT.DispPleasePaid = 1;IOTps.LedDisplay.BIT.DispThankyou = 0;}else if( (((IoEmm31Ptr->TollFare.byte[0]&0xf0)>>4) == 0x0000c) && (IoEmm31Ptr->AxlePaymentDisplay.BIT.Payment != 0x0b) ){IOTps.LedDisplay.BIT.DispPleasePaid = 0;IOTps.LedDisplay.BIT.DispThankyou = 1;}else if( ((IoEmm31Ptr->TollFare.byte[0]&0xf0)>>4) == 0x0000b ){IOTps.LedDisplay.BIT.DispPleasePaid = 0;IOTps.LedDisplay.BIT.DispThankyou = 0;}else{IOTps.LedDisplay.BIT.DispPleasePaid = 0;IOTps.LedDisplay.BIT.DispThankyou = 0;}//CLSIOCls.VehicleClass = IoEmm31Ptr->VehicleClass;if( IoEmm31Ptr->AxlePaymentDisplay.BIT.Axle>0 && IoEmm31Ptr->AxlePaymentDisplay.BIT.Axle<7 ){IOCls.AxleCounterDisplay.BIT.Axle = IoEmm31Ptr->AxlePaymentDisplay.BIT.Axle;}else{IOCls.AxleCounterDisplay.BIT.Axle = 0;}IOCls.AxleCounterDisplay.BIT.RelayContactClose = IoEmm31Ptr->SignageControl.BIT.CanopyBeacon;//EntryLSSIOEntryLss.SignalDisp.BIT.Rlight = IoEmm31Ptr->SignageControl.BIT.Entry_LSS_Rlight;if( IoEmm31Ptr->SignageControl.BIT.Entry_LSS_Glight && IOEmm31.LocalIOInputStatus.BIT.BarrierOpen &&!IOEmm31.LocalIOInputStatus.BIT.BarrierColse ){IOEntryLss.SignalDisp.BIT.Glight = 1;IOEntryLss.SignalDisp.BIT.Rlight = 0;}else{IOEntryLss.SignalDisp.BIT.Glight = 0;IOEntryLss.SignalDisp.BIT.Rlight = 1;}//ExitLSSif( IoEmm31Ptr->SignageControl.BIT.DimmingNormal ){IOTps.LedDisplay.BIT.BrightnessControl = TpsBrightness.Dimmer;IOCls.BrightnessControl.BIT.Brightness = ClsBrightness.Dimmer;IOEntryLss.Status1.BIT.BrightnessControl = EntryLssBrightness.Dimmer;IOExitLss.Status1.BIT.BrightnessControl = ExitLssBrightness.Dimmer;}else{IOTps.LedDisplay.BIT.BrightnessControl = TpsBrightness.Normal;IOCls.BrightnessControl.BIT.Brightness = ClsBrightness.Normal;IOEntryLss.Status1.BIT.BrightnessControl = EntryLssBrightness.Normal;IOExitLss.Status1.BIT.BrightnessControl = ExitLssBrightness.Normal;}
}
//从接收的Emm2IOController31的数据更新Emm31缓冲区
void CopyEmm31ToEmm31Buf( IO_EMM_31 *IoEmm31Ptr )
{uchar *Sptr,*Dptr,i;Sptr = (uchar*)IoEmm31Ptr;Dptr = (uchar*)&IOEmm31;for( i=0; i<11; i++ ){*(Dptr+i+3) = *(Sptr+i+3);}*(Dptr+16) = *(Sptr+16);
}
//更新各设备的亮度值
void CopyEmm32ToDev( IO_EMM_32 *IoEmm32Ptr )
{//TPSTpsBrightness.Dimmer = IoEmm32Ptr->TPSSetting.BIT.Dimmer;TpsBrightness.Normal = IoEmm32Ptr->TPSSetting.BIT.Normal;//CLSClsBrightness.Dimmer = IoEmm32Ptr->CLSSetting.BIT.Dimmer;ClsBrightness.Normal = IoEmm32Ptr->CLSSetting.BIT.Normal;//EntryLSSEntryLssBrightness.Dimmer = IoEmm32Ptr->EntryLSSSetting.BIT.Dimmer;EntryLssBrightness.Normal = IoEmm32Ptr->EntryLSSSetting.BIT.Normal;//ExitLSSExitLssBrightness.Dimmer = IoEmm32Ptr->ExitLSSSetting.BIT.Dimmer;ExitLssBrightness.Normal = IoEmm32Ptr->ExitLSSSetting.BIT.Normal;
}
//判断是否已从EMM接收完整的数据包,并进行处理
void Emm2IOMain( void )
{uchar ver,*ptr;IO_EMM_31 *IoEmm31Ptr;IO_EMM_32 *IoEmm32Ptr;if( Emm2IO.Flg.BIT.Recv ){Emm2IO.Flg.BIT.Recv = 0;Timer[TIMER_STOP].Tick = 500;Timer[TIMER_STOP].Flg.BIT.Enable = 1;if( Emm2IO.Error.byte == 0 ){ver = Checksum( &Emm2IO.RecvBuf[1],Emm2IO.RecvLen-3 );if( Emm2IO.ID==EMM_IO31_ID ){IoEmm31Ptr = (IO_EMM_31 *)Emm2IO.RecvBuf;if( ver==IoEmm31Ptr->Checksum ){CopyEmm31ToDev( IoEmm31Ptr );CopyEmm31ToEmm31Buf( IoEmm31Ptr );ptr = (uchar*)&IOEmm31;ptr++;
//					IOEmm31.AutoTollInputStatus3.byte = IoCheck.SaveState.byte[3];
//					IOEmm31.LocalIOInputStatus.byte = IoCheck.SaveState.byte[0];
//					IOEmm31.AutoTollInputStatus1.byte = IoCheck.SaveState.byte[1];
//					IOEmm31.AutoTollInputStatus2.byte = IoCheck.SaveState.byte[2];
//					IOEmm31.AutoTollInputStatus3.byte = IoCheck.SaveState.byte[3];ver = Checksum( ptr,sizeof(IO_EMM_31)-3 );IOEmm31.Checksum = ver;CopyToUart1SendBuf( (uchar*)&IOEmm31, sizeof(IO_EMM_31) );}}else if( Emm2IO.ID==EMM_IO32_ID ){IoEmm32Ptr = (IO_EMM_32 *)Emm2IO.RecvBuf;if( ver==IoEmm32Ptr->Checksum ){CopyEmm32ToDev( IoEmm32Ptr );CopyToUart1SendBuf( (uchar*)IoEmm32Ptr, sizeof(IO_EMM_32) );}}}else{Emm2IO.Error.byte = 0;}Emm2IO.RecvPtr = 0;Emm2IO.ID = 0;}//When no polling with EMM > 5 seconds.if( Timer[TIMER_STOP].Flg.BIT.TimeOut ){Timer[TIMER_STOP].Flg.BIT.TimeOut = 0;//TMUIOTmu.TollCollectorID[0] = 0x0b;IOTmu.TollCollectorID[1] = 0xbb;IOTmu.TollCollectorID[2] = 0xbb;IOTmu.LoginDuration[0] = 0xbb;IOTmu.LoginDuration[1] = 0xbb;IOTmu.VehicleClass = 0xbb;IOTmu.AxlePaymentDisplay.byte = 0xbb;IOTmu.TMU_Control1.byte = 0x00;IOTmu.TMU_Control2.byte = 0x40;//TPSIOTps.TollFare.word = 0xbbbb;IOTps.LedDisplay.BIT.Rlight = 1;IOTps.LedDisplay.BIT.Glight = 0;IOTps.LedDisplay.BIT.DispPleasePaid = 0;IOTps.LedDisplay.BIT.DispThankyou = 0;//CLSIOCls.VehicleClass = 0xbb;IOCls.AxleCounterDisplay.byte = 0x00;//Entry LssIOEntryLss.SignalDisp.byte = 0x01;//Exit LssIOExitLss.SignalDisp.byte = 0x01;}
}

主程序循环,
在这里插入图片描述
代码多年前写,基于飞利浦双串口51单片机,程序结构是大循环前后台标志,就算现在用上了linux、rtos等的方式,程序接收处理方式差别不大,只是实现起来更简单

下面是完整工程连接
链接:https://pan.baidu.com/s/1bXOrMRH6Gf7kcjra4uANtA?pwd=1234
提取码:1234

这篇关于飞利浦双串口51单片机485网关的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/315865

相关文章

day-51 合并零之间的节点

思路 直接遍历链表即可,遇到val=0跳过,val非零则加在一起,最后返回即可 解题过程 返回链表可以有头结点,方便插入,返回head.next Code /*** Definition for singly-linked list.* public class ListNode {* int val;* ListNode next;* ListNode() {}*

基于51单片机的自动转向修复系统的设计与实现

文章目录 前言资料获取设计介绍功能介绍设计清单具体实现截图参考文献设计获取 前言 💗博主介绍:✌全网粉丝10W+,CSDN特邀作者、博客专家、CSDN新星计划导师,一名热衷于单片机技术探索与分享的博主、专注于 精通51/STM32/MSP430/AVR等单片机设计 主要对象是咱们电子相关专业的大学生,希望您们都共创辉煌!✌💗 👇🏻 精彩专栏 推荐订阅👇🏻 单片机

单片机毕业设计基于单片机的智能门禁系统的设计与实现

文章目录 前言资料获取设计介绍功能介绍程序代码部分参考 设计清单具体实现截图参考文献设计获取 前言 💗博主介绍:✌全网粉丝10W+,CSDN特邀作者、博客专家、CSDN新星计划导师,一名热衷于单片机技术探索与分享的博主、专注于 精通51/STM32/MSP430/AVR等单片机设计 主要对象是咱们电子相关专业的大学生,希望您们都共创辉煌!✌💗 👇🏻 精彩专栏 推荐订

计算机网络基础概念 交换机、路由器、网关、TBOX

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言一、VLAN是什么?二 、交换机三、路由器四、网关五、TBOXTelematics BOX,简称车载T-BOX,车联网系统包含四部分,主机、车载T-BOX、手机APP及后台系统。主机主要用于车内的影音娱乐,以及车辆信息显示;车载T-BOX主要用于和后台系统/手机APP通信,实现手机APP的车辆信息显示与控

代码训练营 Day26 | 47.排序II | 51. N-皇后 |

47.排序II 1.跟46题一样只不过加一个树层去重 class Solution(object):def backtracking(self,nums,path,result,used):# recursion stopif len(path) == len(nums):# collect our setresult.append(path[:])return for i in range(

基于stm32的河流检测系统-单片机毕业设计

文章目录 前言资料获取设计介绍功能介绍具体实现截图参考文献设计获取 前言 💗博主介绍:✌全网粉丝10W+,CSDN特邀作者、博客专家、CSDN新星计划导师,一名热衷于单片机技术探索与分享的博主、专注于 精通51/STM32/MSP430/AVR等单片机设计 主要对象是咱们电子相关专业的大学生,希望您们都共创辉煌!✌💗 👇🏻 精彩专栏 推荐订阅👇🏻 单片机设计精品

Java后端微服务架构下的服务网关设计:Spring Cloud Zuul

Java后端微服务架构下的服务网关设计:Spring Cloud Zuul 大家好,我是微赚淘客返利系统3.0的小编,是个冬天不穿秋裤,天冷也要风度的程序猿! 在微服务架构中,服务网关是微服务系统与外部世界的入口点,它负责请求路由、负载均衡、认证、监控等任务。Spring Cloud Zuul是一个基于Spring Boot的网关服务,它为微服务架构提供了一种灵活、高效的网关解决方案。 服务

安卓开发板_联发科MTK开发评估套件串口调试

串口调试 如果正在进行lk(little kernel ) 或内核开发,USB 串口适配器( USB 转串口 TTL 适配器的简称)对于检查系统启动日志非常有用,特别是在没有图形桌面显示的情况下。 1.选购适配器 常用的许多 USB 转串口的适配器,按芯片来分,有以下几种: CH340PL2303CP2104FT232 一般来说,采用 CH340 芯片的适配器,性能比较稳定,价

VB和51单片机串口通信讲解(只针对VB部分)

标记:该篇文章全部搬自如下网址:http://www.crystalradio.cn/thread-321839-1-1.html,谢谢啦            里面关于中文接收的部分,大家可以好好学习下,题主也在研究中................... Commport;设置或返回串口号。 SettingS:以字符串的形式设置或返回串口通信参数。 Portopen:设置或返回串口

LCP 485. 最大连续 1 的个数[lleetcode -11]

从今天起,我们的算法开始研究搜索,首先就是DFS深度优先搜索(depth-first seach,DFS)在搜索到一个新的节点时,立即对该新节点进行遍 历;因此遍历需要用先入后出的栈来实现,也可以通过与栈等价的递归来实现。对于树结构而言, 由于总是对新节点调用遍历,因此看起来是向着“深”的方向前进。 下面是一个一维的DFS算法 LCP 485. 最大连续 1 的个数 给定一个二进制数组 nu