IEC104.rar

上传者: zcc1229936385 | 上传时间: 2021-08-02 11:07:45 | 文件大小: 80KB | 文件类型: RAR
# IEC104 Protocol of IEC104 and IEC101 ## by chendajie 2014-2015 ## 电网IEC104/IEC101通信协议 ============================== 隔离协议内容与平台或者硬件相关性,已经在stm32平台和linux平台移植测试通过,可轻松移植到其他平台。 ============================================================================ 队列实现的隔离,目前实现简单的先入先出队列,可根据需求用其他队列算法替换。 移植调用实现: 1.在不同平台下,实现_iec10x结构体的函数指针(利用函数指针实现的接口)。 2.调用RegisterIEC10XMoudle,注册实现的_iec10x接口。 3.创建线程一调用Iex104_Receive管理收包解析。 4.创建线程二调用Iec10x_Scheduled实现出队调度。 5.创建线程三实现状态机Iec104_StateMachine,实现协议状态管理,协议包组包入队。 代码内容 IEC0x目录 iec101.c iec101协议包内容 iec104.c iec104协议包内容 iec10x.c 队列初始化,入队出对实现,队列优先级等相关实现,队列调度实现 PRIO_QUEUE_Iec10x.c 队列具体算法实现 test目录 linux上简单测试代码,仅供参考,作者具体协议应用在stm32上,利用状态机控制数据包入队与出队调度 重要函数: Iec10x_Scheduled:出队调度 IEC10X_Enqueue:入队函数 IEC10X_Dequeue:出队函数 IEC10X_FindQHead:查找最高优先级数据包 IEC10X_XXX:前缀为IEC10X_的函数为各个协议包的组包函数 Iec104_StateMachine: 104协议状态机 Iex104_Receive:收包解析 RegisterIEC10XMoudle:协议模块注册,初始化 重要结构体: 用函数指针实现的移植接口,根据不同平台与硬件特性,选择性实现以下接口 typedef struct _iec10x { char * name; int (* Init)(void); void (* Delay_ms)(uint16_t); void (* CloseLink)(void); void *(* Malloc)(uint8_t NumByte); void (* Free)(void *buffer); uint8_t (* enqueue)(Iec10x_PrioQueue_T *QueueHdr, Iec10x_PrioNode_T *NewNode); Iec10x_PrioNode_T *(* dequeue)(Iec10x_PrioQueue_T * QueueHdr); Iec10x_PrioNode_T *(* FindQHead)(Iec10x_PrioQueue_T * QueueHdr); char (* GetPrio)(void); void (* InitQueue)(Iec10x_PrioQueue_T *PrioQueue); void (* ClearQueue)(Iec10x_PrioQueue_T * QueueHdr); uint8_t (* Send)(int socketfd,char *data,int len); uint32_t (* SetTime)(PCP56Time2a_T time); uint32_t (* GetTime)(PCP56Time2a_T time); int8_t (* GetStationState)(uint16_t Addr, uint8_t DevType); float (* GetStaValue)(u

文件下载

资源详情

[{"title":"( 67 个子文件 80KB ) IEC104.rar","children":[{"title":"IEC104","children":[{"title":"IEC10X","children":[{"title":"Iec101.c <span style='color:#111;'> 39.16KB </span>","children":null,"spread":false},{"title":"Iec104.h <span style='color:#111;'> 6.03KB </span>","children":null,"spread":false},{"title":"Iec101.h <span style='color:#111;'> 5.67KB </span>","children":null,"spread":false},{"title":"Iec10x.c <span style='color:#111;'> 4.75KB </span>","children":null,"spread":false},{"title":"Iec104.c <span style='color:#111;'> 45.38KB </span>","children":null,"spread":false},{"title":"PRIO_QUEUE_Iec10x.c <span style='color:#111;'> 3.61KB </span>","children":null,"spread":false},{"title":"PRIO_QUEUE_Iec10x.h <span style='color:#111;'> 105B </span>","children":null,"spread":false},{"title":"Iec10x.h <span style='color:#111;'> 14.84KB </span>","children":null,"spread":false}],"spread":true},{"title":"test","children":[{"title":"common_datatype.h <span style='color:#111;'> 660B </span>","children":null,"spread":false},{"title":"Iec104_Linux.c <span style='color:#111;'> 3.50KB </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 522B </span>","children":null,"spread":false},{"title":"main.h <span style='color:#111;'> 628B </span>","children":null,"spread":false},{"title":"sys.h <span style='color:#111;'> 696B </span>","children":null,"spread":false},{"title":"main.c <span style='color:#111;'> 8.84KB </span>","children":null,"spread":false}],"spread":true},{"title":"README.md <span style='color:#111;'> 3.46KB </span>","children":null,"spread":false},{"title":".git","children":[{"title":"logs","children":[{"title":"HEAD <span style='color:#111;'> 182B </span>","children":null,"spread":false},{"title":"refs","children":[{"title":"heads","children":[{"title":"master <span style='color:#111;'> 182B </span>","children":null,"spread":false}],"spread":true},{"title":"remotes","children":[{"title":"origin","children":[{"title":"HEAD <span style='color:#111;'> 182B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"packed-refs <span style='color:#111;'> 114B </span>","children":null,"spread":false},{"title":"info","children":[{"title":"exclude <span style='color:#111;'> 240B </span>","children":null,"spread":false}],"spread":true},{"title":"lfs","children":[{"title":"tmp","children":[{"title":"objects","children":null,"spread":false}],"spread":true},{"title":"objects","children":[{"title":"logs","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"index <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false},{"title":"objects","children":[{"title":"pack","children":null,"spread":false},{"title":"6c","children":[{"title":"cfe41f832a49439644c7cafc313310e991124e <span style='color:#111;'> 151B </span>","children":null,"spread":false}],"spread":true},{"title":"5c","children":[{"title":"dfd71c8996058238685be2e0ffb46b9b29490f <span style='color:#111;'> 216B </span>","children":null,"spread":false}],"spread":true},{"title":"50","children":[{"title":"b4f3d4517b475776d094b2db00df273d507f01 <span style='color:#111;'> 1.45KB </span>","children":null,"spread":false},{"title":"7baafe6c19e6543b9afba702dd402ef5bbabc6 <span style='color:#111;'> 216B </span>","children":null,"spread":false}],"spread":false},{"title":"info","children":null,"spread":false},{"title":"b2","children":[{"title":"086f80aa0424e139a47b52c32daa62f2660e38 <span style='color:#111;'> 118B </span>","children":null,"spread":false}],"spread":false},{"title":"73","children":[{"title":"43f4f43f956c8db2dc2df47abfc33788bc06a1 <span style='color:#111;'> 165B </span>","children":null,"spread":false}],"spread":false},{"title":"fb","children":[{"title":"4baf9ccdd84fba01ca3e78da93ff39f4e0aa1d <span style='color:#111;'> 3.53KB </span>","children":null,"spread":false}],"spread":false},{"title":"9c","children":[{"title":"a19feab3fc8e17df067775aabaf9230c172a9e <span style='color:#111;'> 148B </span>","children":null,"spread":false}],"spread":false},{"title":"3a","children":[{"title":"933ec06f1838d2c951ec080433d08503c474da <span style='color:#111;'> 321B </span>","children":null,"spread":false}],"spread":false},{"title":"a8","children":[{"title":"fcdfa181c422686507a62124737f11f4e9045e <span style='color:#111;'> 1.54KB </span>","children":null,"spread":false}],"spread":false},{"title":"ae","children":[{"title":"c2cdcba61c9c7c3e81253764998e4c2bc516e4 <span style='color:#111;'> 216B </span>","children":null,"spread":false}],"spread":false},{"title":"33","children":[{"title":"4f5564d9cae434bd0ffb8d1fbb127dd8b94090 <span style='color:#111;'> 85B </span>","children":null,"spread":false}],"spread":false},{"title":"69","children":[{"title":"c626ad43d5f4c10d9c0d155e09dd652f390ff7 <span style='color:#111;'> 1.50KB </span>","children":null,"spread":false}],"spread":false},{"title":"94","children":[{"title":"cb8b35a947035be6ca69d1deafa07c4f9509dd <span style='color:#111;'> 1.46KB </span>","children":null,"spread":false}],"spread":false},{"title":"b7","children":[{"title":"419761715254fcafa01f8f2e432e5f1f37cbb0 <span style='color:#111;'> 5.70KB </span>","children":null,"spread":false}],"spread":false},{"title":"84","children":[{"title":"c37f9bd55320c6a5e7c830be735749356404b6 <span style='color:#111;'> 8.02KB </span>","children":null,"spread":false}],"spread":false},{"title":"59","children":[{"title":"13d44330650d78b6d1ba532a7f162743acfee2 <span style='color:#111;'> 285B </span>","children":null,"spread":false}],"spread":false},{"title":"8c","children":[{"title":"09ba7ab2fe611a79f5e2c786e060589698a284 <span style='color:#111;'> 2.91KB </span>","children":null,"spread":false}],"spread":false},{"title":"cf","children":[{"title":"cb1ffd621ae0767fa4dd996bd9eff862f68fa6 <span style='color:#111;'> 304B </span>","children":null,"spread":false}],"spread":false},{"title":"19","children":[{"title":"cc5a5797541bf5fec333549d196a3562e0e58d <span style='color:#111;'> 2.81KB </span>","children":null,"spread":false}],"spread":false},{"title":"92","children":[{"title":"40b3c5a875c1ec31b5c642b7d951f660bfaf14 <span style='color:#111;'> 1.12KB </span>","children":null,"spread":false}],"spread":false},{"title":"38","children":[{"title":"263ab47ade9571baae5529a1a83f2bbb4b574d <span style='color:#111;'> 2.90KB </span>","children":null,"spread":false}],"spread":false},{"title":"ad","children":[{"title":"5a4f6b3e30e7ebf470fae5a70628c2d872054c <span style='color:#111;'> 350B </span>","children":null,"spread":false}],"spread":false},{"title":"fc","children":[{"title":"ec93d39b2394f8c33eb48f3c7203576d497084 <span style='color:#111;'> 77B </span>","children":null,"spread":false}],"spread":false},{"title":"56","children":[{"title":"20cd98c3a45862ec5850325346ef62508d8246 <span style='color:#111;'> 116B </span>","children":null,"spread":false}],"spread":false},{"title":"3f","children":[{"title":"aed7a0a317fe36a3ca896b26a72fab79839415 <span style='color:#111;'> 1.02KB </span>","children":null,"spread":false}],"spread":false},{"title":"57","children":[{"title":"afb73ab60f26f1352ca449ff2915c51f2105dc <span style='color:#111;'> 116B </span>","children":null,"spread":false}],"spread":false},{"title":"37","children":[{"title":"5613220599bd6f87366a7dd6825ada794bd7d3 <span style='color:#111;'> 116B </span>","children":null,"spread":false}],"spread":false},{"title":"d2","children":[{"title":"4ee89a74970d93bd49587aa4eb73c1e0e26b52 <span style='color:#111;'> 247B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"HEAD <span style='color:#111;'> 23B </span>","children":null,"spread":false},{"title":"config <span style='color:#111;'> 327B </span>","children":null,"spread":false},{"title":"FETCH_HEAD <span style='color:#111;'> 98B </span>","children":null,"spread":false},{"title":"refs","children":[{"title":"heads","children":[{"title":"master <span style='color:#111;'> 41B </span>","children":null,"spread":false}],"spread":false},{"title":"tags","children":null,"spread":false},{"title":"remotes","children":[{"title":"origin","children":[{"title":"HEAD <span style='color:#111;'> 32B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true},{"title":"hooks","children":[{"title":"pre-applypatch.sample <span style='color:#111;'> 424B </span>","children":null,"spread":false},{"title":"pre-push.sample <span style='color:#111;'> 1.32KB </span>","children":null,"spread":false},{"title":"commit-msg.sample <span style='color:#111;'> 896B </span>","children":null,"spread":false},{"title":"pre-commit.sample <span style='color:#111;'> 1.60KB </span>","children":null,"spread":false},{"title":"applypatch-msg.sample <span style='color:#111;'> 478B </span>","children":null,"spread":false},{"title":"prepare-commit-msg.sample <span style='color:#111;'> 1.46KB </span>","children":null,"spread":false},{"title":"update.sample <span style='color:#111;'> 3.53KB </span>","children":null,"spread":false},{"title":"fsmonitor-watchman.sample <span style='color:#111;'> 3.25KB </span>","children":null,"spread":false},{"title":"post-update.sample <span style='color:#111;'> 189B </span>","children":null,"spread":false},{"title":"pre-rebase.sample <span style='color:#111;'> 4.78KB </span>","children":null,"spread":false},{"title":"pre-receive.sample <span style='color:#111;'> 544B </span>","children":null,"spread":false}],"spread":false},{"title":"description <span style='color:#111;'> 73B </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明