-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
33 lines (25 loc) · 758 Bytes
/
test.py
File metadata and controls
33 lines (25 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import serial
import PyCCMDV2 as pyccmd
radioSerial = serial.Serial('COM64', 19200, timeout = 2)
ownID = 65519
talkgroupID = 9900
otherID = 4324
msg = 'Hello World'
radio = pyccmd.Transceiver(radioSerial, ownID, verbose=True, mode = False)
txFlag = False
rxFlag = False
print(radio.getChannel())
print(radio.getESN())
print(radio.getVolume())
print(radio.getCloneComment(linenr=1))
print(radio.getCloneComment(linenr=2))
print(radio.getFreq())
radio.setRadioID(ownID,talkgroupID)
print(radio.getRadioID())
while True:
r = radio.receiveMessage(verbose=False)
if r.messageType == 'CH':
print('Channel changed! Need to re-activate RadioID')
radio.setRadioID(ownID,talkgroupID)
if not r.messageType == 'ERR':
print(r)