struct-frame 0.0.15__tar.gz → 0.0.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of struct-frame might be problematic. Click here for more details.
- {struct_frame-0.0.15 → struct_frame-0.0.16}/PKG-INFO +1 -1
- {struct_frame-0.0.15 → struct_frame-0.0.16}/pyproject.toml +1 -1
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/generate.py +8 -6
- {struct_frame-0.0.15/c → struct_frame-0.0.16/tester}/biostream.sf.h +1 -1
- {struct_frame-0.0.15/ts → struct_frame-0.0.16/testerts}/biostream.sf.ts +1 -1
- struct_frame-0.0.15/tbiostream.sf.ts +0 -92
- struct_frame-0.0.15/tester/biostream.sf.h +0 -68
- struct_frame-0.0.15/tester/biostream.sf.ts +0 -92
- {struct_frame-0.0.15 → struct_frame-0.0.16}/.gitignore +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/LICENSE +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/README.md +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/biostream.proto +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/index.ts +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/main.c +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/myl_vehicle.proto +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/package-lock.json +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/package.json +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/main.py +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/__init__.py +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/__main__.py +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/base.py +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/c/struct_frame.h +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/c/struct_frame_gen.h +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/c/struct_frame_parser.h +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/c/struct_frame_types.h +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/ts/struct_frame.ts +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/ts/struct_frame_gen.ts +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/ts/struct_frame_parser.ts +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/ts/struct_frame_types.ts +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/c_gen.py +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/ts_gen.py +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/tester/struct_frame.h +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/tester/struct_frame_gen.h +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/tester/struct_frame_parser.h +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/tester/struct_frame_types.h +0 -0
- {struct_frame-0.0.15/tester → struct_frame-0.0.16/testerts}/struct_frame.ts +0 -0
- {struct_frame-0.0.15/tester → struct_frame-0.0.16/testerts}/struct_frame_gen.ts +0 -0
- {struct_frame-0.0.15/tester → struct_frame-0.0.16/testerts}/struct_frame_parser.ts +0 -0
- {struct_frame-0.0.15/tester → struct_frame-0.0.16/testerts}/struct_frame_types.ts +0 -0
- {struct_frame-0.0.15 → struct_frame-0.0.16}/tsconfig.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: struct-frame
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.16
|
|
4
4
|
Summary: A framework for serializing data with headers
|
|
5
5
|
Project-URL: Homepage, https://github.com/mylonics/struct-frame
|
|
6
6
|
Project-URL: Issues, https://github.com/mylonics/struct-frame/issues
|
|
@@ -251,8 +251,8 @@ parser = argparse.ArgumentParser(
|
|
|
251
251
|
|
|
252
252
|
parser.add_argument('filename')
|
|
253
253
|
parser.add_argument('--debug', action='store_true')
|
|
254
|
-
parser.add_argument('--c_path', nargs=1, type=str, default=
|
|
255
|
-
parser.add_argument('--ts_path', nargs=1, type=str, default=
|
|
254
|
+
parser.add_argument('--c_path', nargs=1, type=str, default=['c/'])
|
|
255
|
+
parser.add_argument('--ts_path', nargs=1, type=str, default=['ts/'])
|
|
256
256
|
|
|
257
257
|
|
|
258
258
|
def parseFile(filename):
|
|
@@ -307,11 +307,13 @@ def printPackages():
|
|
|
307
307
|
for key, value in packages.items():
|
|
308
308
|
print(value)
|
|
309
309
|
|
|
310
|
+
import os
|
|
311
|
+
import shutil
|
|
310
312
|
|
|
311
313
|
def generateCFileStrings(path):
|
|
312
314
|
out = {}
|
|
313
315
|
for key, value in packages.items():
|
|
314
|
-
name = path
|
|
316
|
+
name = os.path.join(path, value.name + ".sf.h")
|
|
315
317
|
data = ''.join(FileCGen.generate(value))
|
|
316
318
|
out[name] = data
|
|
317
319
|
|
|
@@ -320,13 +322,11 @@ def generateCFileStrings(path):
|
|
|
320
322
|
def generateTsFileStrings(path):
|
|
321
323
|
out = {}
|
|
322
324
|
for key, value in packages.items():
|
|
323
|
-
name = path
|
|
325
|
+
name = os.path.join(path, value.name + ".sf.ts")
|
|
324
326
|
data = ''.join(FileTsGen.generate(value))
|
|
325
327
|
out[name] = data
|
|
326
328
|
return out
|
|
327
329
|
|
|
328
|
-
import os
|
|
329
|
-
import shutil
|
|
330
330
|
|
|
331
331
|
def main():
|
|
332
332
|
args = parser.parse_args()
|
|
@@ -338,6 +338,8 @@ def main():
|
|
|
338
338
|
print(
|
|
339
339
|
f'Recursion Error. Messages most likely have a cyclical dependancy. Check Message: {recErrCurrentMessage} and Field: {recErrCurrentField}')
|
|
340
340
|
|
|
341
|
+
print(args.c_path)
|
|
342
|
+
print(args.ts_path)
|
|
341
343
|
files = generateCFileStrings(args.c_path[0])
|
|
342
344
|
files.update(generateTsFileStrings(args.ts_path[0]))
|
|
343
345
|
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/* Automatically generated struct frame header */
|
|
2
|
-
/* Generated by 0.0.1 at Sat Feb 8 11:47:03 2025. */
|
|
3
|
-
|
|
4
|
-
const typed_struct = require('typed-struct')
|
|
5
|
-
const ExtractType = typeof typed_struct.ExtractType;
|
|
6
|
-
const type = typeof typed_struct.ExtractType;
|
|
7
|
-
|
|
8
|
-
import { struct_frame_buffer } from './struct_frame_types';
|
|
9
|
-
import { msg_encode, msg_reserve, msg_finish } from './struct_frame';
|
|
10
|
-
|
|
11
|
-
/* Enum definitions */
|
|
12
|
-
export enum biostreamadc_sampling_frequency {
|
|
13
|
-
FREQ_1000 = 0,
|
|
14
|
-
FREQ_2000 = 1,
|
|
15
|
-
FREQ_4000 = 2,
|
|
16
|
-
FREQ_8000 = 3,
|
|
17
|
-
FREQ_16000 = 4
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//enum before comment
|
|
21
|
-
export enum biostreamtrans_impedance_gain {
|
|
22
|
-
R_10 = 0,
|
|
23
|
-
R_100 = 1,
|
|
24
|
-
R_1K = 2,
|
|
25
|
-
//Enum inside comment
|
|
26
|
-
R_10K = 3
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* Struct definitions */
|
|
30
|
-
export const biostream_raw_data_t = new typed_struct.Struct('biostream_raw_data_t')
|
|
31
|
-
.Float32LE('ref_v')
|
|
32
|
-
.Float32LE('drn_c')
|
|
33
|
-
.Float32LE('src_v')
|
|
34
|
-
.Float32LE('drn_v')
|
|
35
|
-
.Float32LE('gte_v')
|
|
36
|
-
.Float32LE('phs_v')
|
|
37
|
-
.Float32LE('gte_c')
|
|
38
|
-
.Float32LE('temp')
|
|
39
|
-
.Float32LE('time')
|
|
40
|
-
.compile();
|
|
41
|
-
|
|
42
|
-
export const biostream_raw_data_t_max_size = 36;
|
|
43
|
-
export const RawData_msgid = 1
|
|
44
|
-
export function RawData_encode(buffer: struct_frame_buffer, msg: any) {
|
|
45
|
-
msg_encode(buffer, msg, RawData_msgid)
|
|
46
|
-
}
|
|
47
|
-
export function RawData_reserve(buffer: struct_frame_buffer) {
|
|
48
|
-
const msg_buffer = msg_reserve(buffer, RawData_msgid, RawData_max_size);
|
|
49
|
-
if (msg_buffer){
|
|
50
|
-
return new RawData(msg_buffer)
|
|
51
|
-
}
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
export function RawData_finish(buffer: struct_frame_buffer) {
|
|
55
|
-
msg_finish(buffer);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
export const biostream_adc_command_t = new typed_struct.Struct('biostream_adc_command_t')
|
|
60
|
-
.Boolean8('enable')
|
|
61
|
-
.biostream_adc_sampling_frequency('samplig_freq')
|
|
62
|
-
.biostream_uint8('over_sampling_rate')
|
|
63
|
-
.biostream_trans_impedance_gain('drain_res')
|
|
64
|
-
.biostream_trans_impedance_gain('gate_res')
|
|
65
|
-
.compile();
|
|
66
|
-
|
|
67
|
-
export const biostream_adc_command_t_max_size = 5;
|
|
68
|
-
export const AdcCommand_msgid = 112
|
|
69
|
-
export function AdcCommand_encode(buffer: struct_frame_buffer, msg: any) {
|
|
70
|
-
msg_encode(buffer, msg, AdcCommand_msgid)
|
|
71
|
-
}
|
|
72
|
-
export function AdcCommand_reserve(buffer: struct_frame_buffer) {
|
|
73
|
-
const msg_buffer = msg_reserve(buffer, AdcCommand_msgid, AdcCommand_max_size);
|
|
74
|
-
if (msg_buffer){
|
|
75
|
-
return new AdcCommand(msg_buffer)
|
|
76
|
-
}
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
export function AdcCommand_finish(buffer: struct_frame_buffer) {
|
|
80
|
-
msg_finish(buffer);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export function get_message_length(msg_id : number){
|
|
86
|
-
switch (msg_id)
|
|
87
|
-
{
|
|
88
|
-
case raw_data_t_msgid: return raw_data_t_max_size;
|
|
89
|
-
case adc_command_t_msgid: return adc_command_t_max_size;
|
|
90
|
-
default: break;
|
|
91
|
-
} return 0;
|
|
92
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/* Automatically generated struct frame header */
|
|
2
|
-
/* Generated by 0.0.1 at Sat Feb 8 11:54:37 2025. */
|
|
3
|
-
|
|
4
|
-
#pragma once
|
|
5
|
-
#pragma pack(1)
|
|
6
|
-
#include "struct_frame.h"
|
|
7
|
-
/* Enum definitions */
|
|
8
|
-
typedef enum BiostreamAdcSamplingFrequency {
|
|
9
|
-
ADC_SAMPLING_FREQUENCY_FREQ_1000 = 0,
|
|
10
|
-
ADC_SAMPLING_FREQUENCY_FREQ_2000 = 1,
|
|
11
|
-
ADC_SAMPLING_FREQUENCY_FREQ_4000 = 2,
|
|
12
|
-
ADC_SAMPLING_FREQUENCY_FREQ_8000 = 3,
|
|
13
|
-
ADC_SAMPLING_FREQUENCY_FREQ_16000 = 4
|
|
14
|
-
} BiostreamAdcSamplingFrequency;
|
|
15
|
-
typedef uint8_t BiostreamAdcSamplingFrequency_t;
|
|
16
|
-
|
|
17
|
-
//enum before comment
|
|
18
|
-
typedef enum BiostreamTransImpedanceGain {
|
|
19
|
-
TRANS_IMPEDANCE_GAIN_R_10 = 0,
|
|
20
|
-
TRANS_IMPEDANCE_GAIN_R_100 = 1,
|
|
21
|
-
TRANS_IMPEDANCE_GAIN_R_1K = 2,
|
|
22
|
-
//Enum inside comment
|
|
23
|
-
TRANS_IMPEDANCE_GAIN_R_10K = 3
|
|
24
|
-
} BiostreamTransImpedanceGain;
|
|
25
|
-
typedef uint8_t BiostreamTransImpedanceGain_t;
|
|
26
|
-
|
|
27
|
-
/* Struct definitions */
|
|
28
|
-
typedef struct BiostreamRawdata {
|
|
29
|
-
float refV;
|
|
30
|
-
float drnC;
|
|
31
|
-
float srcV;
|
|
32
|
-
float drnV;
|
|
33
|
-
float gteV;
|
|
34
|
-
float phsV;
|
|
35
|
-
float gteC;
|
|
36
|
-
float temp;
|
|
37
|
-
float time;
|
|
38
|
-
} BiostreamRawdata;
|
|
39
|
-
|
|
40
|
-
#define BIOSTREAM_RAW_DATA_MAX_SIZE 36;
|
|
41
|
-
#define BIOSTREAM_RAW_DATA_MSG_ID 1
|
|
42
|
-
MESSAGE_HELPER(biostream_raw_data, BiostreamRawdata, 36, 1);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
typedef struct BiostreamAdccommand {
|
|
47
|
-
bool enable;
|
|
48
|
-
BiostreamAdcSamplingFrequency_t sampligFreq;
|
|
49
|
-
uint8_t overSamplingRate;
|
|
50
|
-
BiostreamTransImpedanceGain_t drainRes;
|
|
51
|
-
BiostreamTransImpedanceGain_t gateRes;
|
|
52
|
-
} BiostreamAdccommand;
|
|
53
|
-
|
|
54
|
-
#define BIOSTREAM_ADC_COMMAND_MAX_SIZE 5;
|
|
55
|
-
#define BIOSTREAM_ADC_COMMAND_MSG_ID 112
|
|
56
|
-
MESSAGE_HELPER(biostream_adc_command, BiostreamAdccommand, 5, 112);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
uint8_t get_message_length(uint8_t msg_id){
|
|
62
|
-
switch (msg_id)
|
|
63
|
-
{
|
|
64
|
-
case BIOSTREAM_RAW_DATA_MSG_ID: return BIOSTREAM_RAW_DATA_MAX_SIZE;
|
|
65
|
-
case BIOSTREAM_ADC_COMMAND_MSG_ID: return BIOSTREAM_ADC_COMMAND_MAX_SIZE;
|
|
66
|
-
default: break;
|
|
67
|
-
} return 0;
|
|
68
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/* Automatically generated struct frame header */
|
|
2
|
-
/* Generated by 0.0.1 at Sat Feb 8 11:54:37 2025. */
|
|
3
|
-
|
|
4
|
-
const typed_struct = require('typed-struct')
|
|
5
|
-
const ExtractType = typeof typed_struct.ExtractType;
|
|
6
|
-
const type = typeof typed_struct.ExtractType;
|
|
7
|
-
|
|
8
|
-
import { struct_frame_buffer } from './struct_frame_types';
|
|
9
|
-
import { msg_encode, msg_reserve, msg_finish } from './struct_frame';
|
|
10
|
-
|
|
11
|
-
/* Enum definitions */
|
|
12
|
-
export enum biostreamadc_sampling_frequency {
|
|
13
|
-
FREQ_1000 = 0,
|
|
14
|
-
FREQ_2000 = 1,
|
|
15
|
-
FREQ_4000 = 2,
|
|
16
|
-
FREQ_8000 = 3,
|
|
17
|
-
FREQ_16000 = 4
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//enum before comment
|
|
21
|
-
export enum biostreamtrans_impedance_gain {
|
|
22
|
-
R_10 = 0,
|
|
23
|
-
R_100 = 1,
|
|
24
|
-
R_1K = 2,
|
|
25
|
-
//Enum inside comment
|
|
26
|
-
R_10K = 3
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* Struct definitions */
|
|
30
|
-
export const biostream_raw_data_t = new typed_struct.Struct('biostream_raw_data_t')
|
|
31
|
-
.Float32LE('ref_v')
|
|
32
|
-
.Float32LE('drn_c')
|
|
33
|
-
.Float32LE('src_v')
|
|
34
|
-
.Float32LE('drn_v')
|
|
35
|
-
.Float32LE('gte_v')
|
|
36
|
-
.Float32LE('phs_v')
|
|
37
|
-
.Float32LE('gte_c')
|
|
38
|
-
.Float32LE('temp')
|
|
39
|
-
.Float32LE('time')
|
|
40
|
-
.compile();
|
|
41
|
-
|
|
42
|
-
export const biostream_raw_data_t_max_size = 36;
|
|
43
|
-
export const RawData_msgid = 1
|
|
44
|
-
export function RawData_encode(buffer: struct_frame_buffer, msg: any) {
|
|
45
|
-
msg_encode(buffer, msg, RawData_msgid)
|
|
46
|
-
}
|
|
47
|
-
export function RawData_reserve(buffer: struct_frame_buffer) {
|
|
48
|
-
const msg_buffer = msg_reserve(buffer, RawData_msgid, RawData_max_size);
|
|
49
|
-
if (msg_buffer){
|
|
50
|
-
return new RawData(msg_buffer)
|
|
51
|
-
}
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
export function RawData_finish(buffer: struct_frame_buffer) {
|
|
55
|
-
msg_finish(buffer);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
export const biostream_adc_command_t = new typed_struct.Struct('biostream_adc_command_t')
|
|
60
|
-
.Boolean8('enable')
|
|
61
|
-
.biostream_adc_sampling_frequency('samplig_freq')
|
|
62
|
-
.biostream_uint8('over_sampling_rate')
|
|
63
|
-
.biostream_trans_impedance_gain('drain_res')
|
|
64
|
-
.biostream_trans_impedance_gain('gate_res')
|
|
65
|
-
.compile();
|
|
66
|
-
|
|
67
|
-
export const biostream_adc_command_t_max_size = 5;
|
|
68
|
-
export const AdcCommand_msgid = 112
|
|
69
|
-
export function AdcCommand_encode(buffer: struct_frame_buffer, msg: any) {
|
|
70
|
-
msg_encode(buffer, msg, AdcCommand_msgid)
|
|
71
|
-
}
|
|
72
|
-
export function AdcCommand_reserve(buffer: struct_frame_buffer) {
|
|
73
|
-
const msg_buffer = msg_reserve(buffer, AdcCommand_msgid, AdcCommand_max_size);
|
|
74
|
-
if (msg_buffer){
|
|
75
|
-
return new AdcCommand(msg_buffer)
|
|
76
|
-
}
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
export function AdcCommand_finish(buffer: struct_frame_buffer) {
|
|
80
|
-
msg_finish(buffer);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export function get_message_length(msg_id : number){
|
|
86
|
-
switch (msg_id)
|
|
87
|
-
{
|
|
88
|
-
case raw_data_t_msgid: return raw_data_t_max_size;
|
|
89
|
-
case adc_command_t_msgid: return adc_command_t_max_size;
|
|
90
|
-
default: break;
|
|
91
|
-
} return 0;
|
|
92
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/c/struct_frame_gen.h
RENAMED
|
File without changes
|
{struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/c/struct_frame_parser.h
RENAMED
|
File without changes
|
{struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/c/struct_frame_types.h
RENAMED
|
File without changes
|
|
File without changes
|
{struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/ts/struct_frame_gen.ts
RENAMED
|
File without changes
|
{struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/ts/struct_frame_parser.ts
RENAMED
|
File without changes
|
{struct_frame-0.0.15 → struct_frame-0.0.16}/src/struct_frame/boilerplate/ts/struct_frame_types.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|