這裡的Serial communications是一個簡單的遠端多層控制系統, 目前使用於交9行控中心, 起因2001年9月台北捷運淹水後, 重新建置時所設計, 時機恰好小弟處於就讀二技期間, 極度缺乏生活費與學費時, 這個系統針對淡水, 板南, 新店各車站進行PA廣播系統的控制, 基礎架構如下
IA(Information Assistor)/LC(Line Controller)(Multiple) <==> TRTS Server(Single) <==> Station(Multiple)
這裡只分析 IA/LC<==> TRTS Server 部份 Protocol 作為我的 Python Study練習(用了多年後, 日前說有時會有車站無法控制, 問題是我早就忘光光了, 只好寫一個Protocl analysis program 看看有沒有問題, 目前只看的出, 車站狀態並無回應給 IA/LC, 待查), 這個系統也讓我有機會在RS485上面實作了簡單的 Tokon Ring 的設計而得到與之前Collision/Retry Send不同的經驗
Serial port Capture Sample
0 上午 05:29:45 Trts_s20070701. IRP_MJ_WRITE Serial0 SUCCESS Length 8: 16 02 01 FF 08 04 A5 5A
625 上午 05:30:10 Trts_s20070701. IRP_MJ_READ Serial0 SUCCESS Length 7: 16 03 03 01 88 01 02
761 上午 05:30:15 Trts_s20070701. IRP_MJ_READ Serial0 SUCCESS Length 7: 16 03 03 01 88 01 02
Result
Src:(03)=>Tag:(01), OCH Control :All release
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), Line:0x03, Station:0x1D(29), Set Stastion: GetTalk
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), OCH Control :All release
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), Line:0x03, Station:0x1D(29), Set Stastion: ReleaseTalk
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), OCH Control :All release
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), Line:0x03, Station:0x1D(29), Set Stastion: GetTalk
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), OCH Control :All release
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), Line:0x03, Station:0x1D(29), Set Stastion: ReleaseTalk
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), OCH Control :All release
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), Line:0x03, Station:0x1D(29), Set Stastion: ReleaseTalk
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), OCH Control :All release
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(03)=>Tag:(01), Line:0x03, Station:0x1D(29), Set Stastion: GetTalk
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(01) Boardcast, Control: Handle a Line: 0x03
Src:(03)=>Tag:(01), PALOS response an Ack
Src:(01)=>Tag:(03), Line:0x03, Station:0x1D(29), Station status: CC gotted handle
Src:(03)=>Tag:(01), PALOS response an Ack
Src:(03)=>Tag:(01), OCH Control :All release
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Src:(01) Boardcast, Control: Release a Line: 0x03
Src:(03)=>Tag:(01), PALOS response an Ack
Src:(03)=>Tag:(01), Line:0x03, Station:0x1D(29), Set Stastion: ReleaseTalk
Src:(01)=>Tag:(03), TRTS Server send an OCH Ack
Source , 這個Source Code 是很差的Code style 也還沒有真的Python Style 只是能動而已, 非常之醜, 希望有時間繼續Refactoring