Skip to content

Commit

Permalink
added self inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
o-murphy committed Nov 15, 2023
1 parent 0aefd34 commit 3e3cc39
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ python -m infiray-lrf
# commands list:
q - quit
h - help

i - self inspection

s - single ranging
cf <int:frequency> <int:timeout>
- continious ranging (frequency 1~10Hz, timout - seconds)
Expand Down
2 changes: 1 addition & 1 deletion infiray_lrf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.0.0'
__version__ = '1.0.1'
__author__ = "o-murphy"
__credits__ = ["Dmytro Yaroshenko"]
__copyright__ = ('2023 Yaroshenko Dmytro (https://github.com/o-murphy)', )
12 changes: 6 additions & 6 deletions infiray_lrf/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@
temperature=Enum(Bit,
normal=1,
exception=0),
reserve=Bit
_reserve=Bit
))

TSelfInspect = Struct(
status3=Byte, # reserved
status2=Byte,
status1=TSelfStatus,
_reserved=Byte, # reserved
echo_intensity=Byte,
system=TSelfStatus,
status0=BitStruct(
v5_power=Enum(Bit,
normal=1,
exception=0),
reserve=Bit[7]
_reserve=Bit[7]
),
)

Expand Down Expand Up @@ -172,7 +172,7 @@ def crc(ctx):
cmd=COMMAND,
params=Switch(
this.cmd, {
COMMAND.SelfInspection: TSelfInspect,
# COMMAND.SelfInspection: TSelfInspect,
COMMAND.SetFirstLast: TSetFirstLast,
COMMAND.SetFrequency: TSetFrequency,

Expand Down
6 changes: 6 additions & 0 deletions infiray_lrf/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def write_serial(intf):
if message == 's':
cmd = command_request_struct.build({'cmd': COMMAND.SingleRanging, 'params': None})

elif message == 'i':
cmd = command_request_struct.build({'cmd': COMMAND.SelfInspection, 'params': None})

elif message == 'C':
cmd = command_request_struct.build({'cmd': COMMAND.ContinuousRanging, 'params': None})

Expand Down Expand Up @@ -182,6 +185,9 @@ def show_help():
q\t - quit
h\t - help
i\t - self inspection
s\t - single ranging
cf <int:frequency> <int:timeout>
\t - continious ranging (frequency 1~10Hz, timout - seconds)
Expand Down

0 comments on commit 3e3cc39

Please # to comment.