struct-frame 0.0.11__tar.gz → 0.0.13__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.

Files changed (28) hide show
  1. {struct_frame-0.0.11 → struct_frame-0.0.13}/PKG-INFO +6 -3
  2. {struct_frame-0.0.11 → struct_frame-0.0.13}/README.md +5 -2
  3. struct_frame-0.0.13/c/biostream.sf.h +68 -0
  4. {struct_frame-0.0.11 → struct_frame-0.0.13}/pyproject.toml +1 -1
  5. struct_frame-0.0.13/src/struct-frame/__init__.py +6 -0
  6. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/__main__.py +2 -2
  7. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/c_gen.py +1 -1
  8. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/ts_gen.py +1 -1
  9. struct_frame-0.0.13/ts/biostream.sf.ts +92 -0
  10. struct_frame-0.0.11/src/struct-frame/__init__.py +0 -3
  11. {struct_frame-0.0.11 → struct_frame-0.0.13}/.gitignore +0 -0
  12. {struct_frame-0.0.11 → struct_frame-0.0.13}/LICENSE +0 -0
  13. {struct_frame-0.0.11 → struct_frame-0.0.13}/biostream.proto +0 -0
  14. {struct_frame-0.0.11 → struct_frame-0.0.13}/index.ts +0 -0
  15. {struct_frame-0.0.11 → struct_frame-0.0.13}/main.c +0 -0
  16. {struct_frame-0.0.11 → struct_frame-0.0.13}/myl_vehicle.proto +0 -0
  17. {struct_frame-0.0.11 → struct_frame-0.0.13}/package-lock.json +0 -0
  18. {struct_frame-0.0.11 → struct_frame-0.0.13}/package.json +0 -0
  19. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/base.py +0 -0
  20. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/boilerplate/c/struct_frame.h +0 -0
  21. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/boilerplate/c/struct_frame_gen.h +0 -0
  22. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/boilerplate/c/struct_frame_parser.h +0 -0
  23. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/boilerplate/c/struct_frame_types.h +0 -0
  24. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/boilerplate/ts/struct_frame.ts +0 -0
  25. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/boilerplate/ts/struct_frame_gen.ts +0 -0
  26. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/boilerplate/ts/struct_frame_parser.ts +0 -0
  27. {struct_frame-0.0.11 → struct_frame-0.0.13}/src/struct-frame/boilerplate/ts/struct_frame_types.ts +0 -0
  28. {struct_frame-0.0.11 → struct_frame-0.0.13}/tsconfig.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: struct-frame
3
- Version: 0.0.11
3
+ Version: 0.0.13
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
@@ -28,6 +28,9 @@ npx tsc --project tsconfig.json; node index.js
28
28
 
29
29
  building package
30
30
  py -m build
31
- py -m twine upload --repository testpypi dist/*
31
+ py -m twine upload dist/*
32
32
 
33
- py -m pip install --upgrade twine
33
+ py -m pip install --upgrade twine
34
+
35
+
36
+ run locally python .\src\struct-frame
@@ -13,6 +13,9 @@ npx tsc --project tsconfig.json; node index.js
13
13
 
14
14
  building package
15
15
  py -m build
16
- py -m twine upload --repository testpypi dist/*
16
+ py -m twine upload dist/*
17
17
 
18
- py -m pip install --upgrade twine
18
+ py -m pip install --upgrade twine
19
+
20
+
21
+ run locally python .\src\struct-frame
@@ -0,0 +1,68 @@
1
+ /* Automatically generated struct frame header */
2
+ /* Generated by 0.0.1 at Sat Feb 8 11:10:26 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
+ }
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "struct-frame"
7
- version = "0.0.11"
7
+ version = "0.0.13"
8
8
  authors = [
9
9
  { name="Rijesh Augustine", email="rijesh@mylonics.com" },
10
10
  ]
@@ -0,0 +1,6 @@
1
+ from base import version, NamingStyleC, CamelToSnakeCase, pascalCase
2
+
3
+ from c_gen import FileCGen
4
+ from ts_gen import FileTsGen
5
+
6
+ __all__ = ["FileCGen", "FileTsGen", "version", "NamingStyleC", "CamelToSnakeCase", "pascalCase"]
@@ -2,8 +2,8 @@
2
2
  # kate: replace-tabs on; indent-width 4;
3
3
 
4
4
 
5
- from .c_gen import FileCGen
6
- from .ts_gen import FileTsGen
5
+ from c_gen import FileCGen
6
+ from ts_gen import FileTsGen
7
7
  from proto_schema_parser.parser import Parser
8
8
  from proto_schema_parser import ast
9
9
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  # kate: replace-tabs on; indent-width 4;
3
3
 
4
- from .base import version, NamingStyleC, CamelToSnakeCase, pascalCase
4
+ from base import version, NamingStyleC, CamelToSnakeCase, pascalCase
5
5
  import time
6
6
 
7
7
  StyleC = NamingStyleC()
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  # kate: replace-tabs on; indent-width 4;
3
3
 
4
- from .base import version, NamingStyleC
4
+ from base import version, NamingStyleC
5
5
  import time
6
6
 
7
7
  StyleC = NamingStyleC()
@@ -0,0 +1,92 @@
1
+ /* Automatically generated struct frame header */
2
+ /* Generated by 0.0.1 at Sat Feb 8 11:10:26 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,3 +0,0 @@
1
- #from .ast import Field, FieldCardinality, Message, Option
2
- #from .parser import Parser
3
- #__all__ = ["Parser", "Message", "Field", "Option", "FieldCardinality"]
File without changes
File without changes
File without changes
File without changes