Commit 6e7269c45e3b5d7b2e82c411ce131aaf3ecf7932
1 parent
0538ed53
Exists in
dev
bugfix gemini test
Showing
1 changed file
with
10 additions
and
10 deletions
Show diff stats
src/device_controller/concrete_component/gemini/gemini_controller.py
... | ... | @@ -115,27 +115,27 @@ class DC_Gemini(DeviceController): |
115 | 115 | @classmethod |
116 | 116 | def encap(cls, command:str): |
117 | 117 | r''' Encapsulate useful data to be ready for sending |
118 | - | |
118 | + | |
119 | 119 | If data is "complete" (with stamp, and well formatted), send it as is |
120 | 120 | Otherwise, add stamp and format it |
121 | - | |
121 | + | |
122 | 122 | 3 types of commands: |
123 | 123 | - TYPE1: '06' or '050000' |
124 | 124 | - TYPE2: ':cde#' (mainly ':??#' - i.e : ':GD#', ':GR#', ...) |
125 | 125 | - TYPE3: 'b?#' (bC# = Cold Start, bW# = selecting Warm Start, bR# = selecting Warm Restart) |
126 | - | |
126 | + | |
127 | 127 | :Examples: |
128 | - >>> tele = DC_Gemini("localhost", 11110, DEBUG=False) | |
128 | + >>> tele = DC_Gemini("localhost", 11110) | |
129 | 129 | Starting device simulator on (host:port): localhost:11110 |
130 | 130 | >>> tele.encap(':GD#') |
131 | - '00010000:GD#\x00' | |
131 | + ('00010000', '00010000:GD#\x00') | |
132 | 132 | >>> tele.encap(':GR#') |
133 | - '00020000:GR#\x00' | |
133 | + ('00020000', '00020000:GR#\x00') | |
134 | 134 | >>> tele.close() |
135 | - | |
135 | + | |
136 | 136 | # ne marche pas => '00010000:GD#\x00' |
137 | 137 | ''' |
138 | - | |
138 | + | |
139 | 139 | ####return bytes(self.MYSTAMP + self.STAMP_FILLER + data + "\n", "utf-8") |
140 | 140 | |
141 | 141 | # TYPE1 |
... | ... | @@ -180,10 +180,10 @@ class DC_Gemini(DeviceController): |
180 | 180 | r""" |
181 | 181 | Extract useful data from received raw data |
182 | 182 | |
183 | - >>> tele = DC_Gemini("localhost", 11110, DEBUG=False) | |
183 | + >>> tele = DC_Gemini("localhost", 11110) | |
184 | 184 | Starting device simulator on (host:port): localhost:11110 |
185 | 185 | >>> tele.last_stamp = '00170000' |
186 | - >>> tele.uncap('001700001#') | |
186 | + >>> tele.uncap('00170000', '001700001#') | |
187 | 187 | '1' |
188 | 188 | >>> tele.close() |
189 | 189 | """ | ... | ... |