Repository navigation
Expand file tree
/
Copy pathobject_textapi_settings.h
More file actions
65 lines (54 loc) · 2.94 KB
/
Copy pathobject_textapi_settings.h
File metadata and controls
65 lines (54 loc) · 2.94 KB
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
#ifndef _OBJECT_TEXTAPI_SETTINGS_H_
#define _OBJECT_TEXTAPI_SETTINGS_H_
#include <Python.h>
#include <structmember.h>
#if (defined(_WIN32) || defined(__WIN32__))
#ifndef USING_STUDIO_8
#define USING_STUDIO_8 1
#endif
#include <icsnVC40.h>
#else
#include <icsnVC40.h>
#endif
#include "defines.h"
#define TEXTAPI_SETTINGS_OBJECT_NAME "TextApiSettings"
typedef struct {
PyObject_HEAD
STextAPISettings s;
} textapi_settings_object;
static PyMemberDef textapi_settings_object_members[] = {
{ "can1_tx_id", T_UINT, offsetof(textapi_settings_object, s.can1_tx_id), 0, "Sets or Reads the Arbitration ID for Sending Text API commands" },
{ "can1_rx_id",T_UINT, offsetof(textapi_settings_object, s.can1_rx_id), 0, "Sets or Reads the Arbitration ID for Sending Receiving API commands" },
{ "can1_options", T_UINT, offsetof(textapi_settings_object, s.can1_options), 0, "Sets the length of the Arbitration ID's. Set to 1 for Extended and 0 for Standard" },
{ "can2_tx_id", T_UINT, offsetof(textapi_settings_object, s.can2_tx_id), 0, "" },
{ "can2_rx_id", T_UINT, offsetof(textapi_settings_object, s.can2_rx_id), 0, "" },
{ "can2_options", T_UINT, offsetof(textapi_settings_object, s.can2_options), 0, "" },
{ "network_enables", T_UINT, offsetof(textapi_settings_object, s.network_enables), 0, "Bitfield telling which netowrk to support Text API." },
{ "can3_tx_id", T_UINT, offsetof(textapi_settings_object, s.can3_tx_id), 0, "" },
{ "can3_rx_id", T_UINT, offsetof(textapi_settings_object, s.can3_rx_id), 0, "" },
{ "can3_options", T_UINT, offsetof(textapi_settings_object, s.can3_options), 0, "" },
{ "can4_tx_id", T_UINT, offsetof(textapi_settings_object, s.can4_tx_id), 0, "" },
{ "can4_rx_id", T_UINT, offsetof(textapi_settings_object, s.can4_rx_id), 0, "" },
{ "can4_options", T_UINT, offsetof(textapi_settings_object, s.can4_options), 0, "" },
/*
{ "Reserved0", T_INT, offsetof(textapi_settings_object, s.Reserved0), 0, "Not used" },
{ "Reserved1", T_INT, offsetof(textapi_settings_object, s.Reserved1), 0, "Not used" },
{ "Reserved2", T_INT, offsetof(textapi_settings_object, s.Reserved2), 0, "Not used" },
{ "Reserved3", T_INT, offsetof(textapi_settings_object, s.Reserved3), 0, "Not used" },
{ "Reserved4", T_INT, offsetof(textapi_settings_object, s.Reserved3), 0, "Not used" },
*/
{ NULL, 0, 0, 0, 0 },
};
static int textapi_settings_object_init(textapi_settings_object* self, PyObject* args, PyObject* kwds)
{
// Initialize all struct values to 0
memset(&(self->s), 0, sizeof(self->s));
return 0;
}
extern PyTypeObject textapi_settings_object_type;
// Copied from tupleobject.h
#define PyTextApiSettings_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BASETYPE)
#define PyTextApiSettings_CheckExact(op) (Py_TYPE(op) == &textapi_settings_object_type)
bool setup_textapi_settings_object(PyObject* module);
#endif // _OBJECT_TEXTAPI_SETTINGS_H_