-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsend_msg_headers.py
80 lines (53 loc) · 1.77 KB
/
send_msg_headers.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# !/usr/bin/python3
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
class SendMessageHeader(object):
"""
Define names for message headers sent to the Bpod device.
The message header is the first byte (character) on a message sent.
"""
#: Request initialization handshake
HANDSHAKE = "6"
#: Request firmware build number
FIRMWARE_VERSION = "F"
#: Reset session clock
RESET_CLOCK = "*"
#: Pause ongoing trial (We recommend using computer-side pauses between trials, to keep data uniform)
PAUSE_TRIAL = "$"
#: Return timestamp transmission scheme
GET_TIMESTAMP_TRANSMISSION = "G"
#: Request hardware configuration
HARDWARE_DESCRIPTION = "H"
#: Request enable input ports
ENABLE_PORTS = "E"
#: Set sync channel and sync mode
SYNC_CHANNEL_MODE = "K"
#: Send new compressed state matrix
NEW_STATE_MATRIX = "C"
#: Request to run state matrix now
RUN_STATE_MACHINE = "R"
#: Load serial message
LOAD_SERIAL_MESSAGE = "L"
#: Reset serial messages to equivalent byte codes (i.e. message# 4 = one byte, 0x4)
RESET_SERIAL_MESSAGES = ">"
#: Override digital hardware state
OVERRIDE_DIGITAL_HW_STATE = "O"
#: Send byte to hardware serial channel 1-3
SEND_TO_HW_SERIAL = "U"
#: Request end of connection now
DISCONNECT = "Z"
#: Get the modules connected to bpod
GET_MODULES = "M"
#: Set module relay
SET_MODULE_RELAY = "J"
#: Write to the module
WRITE_TO_MODULE = "T"
#: Echo soft code
ECHO_SOFTCODE = "S"
#: Manual override: execute virtual event
MANUAL_OVERRIDE_EXEC_EVENT = "V"
#: Trigger soft code
TRIGGER_SOFTCODE = "~"
#: Exit state matrix and return data
EXIT_AND_RETURN = "X"