Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tommy Olofsson
LabComm
Commits
1279cb03
Commit
1279cb03
authored
10 years ago
by
Sven Gestegård Robertz
Browse files
Options
Downloads
Patches
Plain Diff
c decoder still skips pragma, decoding is wip, see comment
parent
2720b0d8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/c/Makefile
+1
-0
1 addition, 0 deletions
lib/c/Makefile
lib/c/labcomm_bytearray_reader.c
+6
-0
6 additions, 0 deletions
lib/c/labcomm_bytearray_reader.c
lib/c/labcomm_decoder.c
+6
-0
6 additions, 0 deletions
lib/c/labcomm_decoder.c
with
13 additions
and
0 deletions
lib/c/Makefile
+
1
−
0
View file @
1279cb03
...
...
@@ -27,6 +27,7 @@ OBJS=labcomm_memory.o \
labcomm.o
\
labcomm_dynamic_buffer_writer.o
\
labcomm_fd_reader.o labcomm_fd_writer.o
\
labcomm_bytearray_reader.o
\
labcomm_pthread_scheduler.o
#FIXME: labcomm_mem_reader.o labcomm_mem_writer.o
...
...
This diff is collapsed.
Click to expand it.
lib/c/labcomm_bytearray_reader.c
+
6
−
0
View file @
1279cb03
...
...
@@ -34,9 +34,15 @@ struct labcomm_bytearray_reader {
int
bytearray_size
;
};
#if 0
// XXX HERE BE DRAGONS: version removed?
static int bytearray_alloc(struct labcomm_reader *r,
struct labcomm_reader_action_context *action_context,
char *version)
#else
static
int
bytearray_alloc
(
struct
labcomm_reader
*
r
,
struct
labcomm_reader_action_context
*
action_context
)
#endif
{
int
result
=
0
;
...
...
This diff is collapsed.
Click to expand it.
lib/c/labcomm_decoder.c
+
6
−
0
View file @
1279cb03
...
...
@@ -233,6 +233,7 @@ out:
static
int
decoder_skip
(
struct
labcomm_decoder
*
d
,
int
len
)
{
int
i
;
printf
(
"skipping %d bytes
\n
"
,
len
);
for
(
i
=
0
;
i
<
len
;
i
++
){
labcomm_read_byte
(
d
->
reader
);
if
(
d
->
reader
->
error
<
0
)
{
...
...
@@ -252,6 +253,7 @@ static int decode_pragma(struct labcomm_decoder *d, int len)
}
int
bytes
=
labcomm_size_string
(
pragma_type
);
int
psize
=
len
-
bytes
;
printf
(
"got pragma: %s
\n
"
,
pragma_type
);
if
(
0
/*d->pragma_handler*/
)
{
//read the entire packet to a buffer and then run
// decode on that through a bytearray_reader.
...
...
@@ -265,11 +267,15 @@ static int decode_pragma(struct labcomm_decoder *d, int len)
goto
out
;
}
}
printf
(
"read %d bytes
\n
"
,
psize
);
//TODO: add wrapped decoders, and create pragma decoder that does not
// expect a version packet
struct
labcomm_reader
*
pr
=
labcomm_bytearray_reader_new
(
d
->
reader
->
memory
,
pragma_data
,
psize
);
struct
labcomm_decoder
*
pd
=
labcomm_decoder_new
(
pr
,
d
->
error
,
d
->
memory
,
d
->
scheduler
);
/* d->prama_handler(pd, ptype, plen); */
labcomm_decoder_run
(
pd
);
internal_labcomm_decoder_free
(
pd
);
result
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment