Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
LabComm
Commits
713dd66b
Commit
713dd66b
authored
Nov 12, 2014
by
Sven Gestegård Robertz
Browse files
merge from master
parents
0ebaa10d
59729683
Changes
27
Show whitespace changes
Inline
Side-by-side
lib/c/labcomm_encoder.c
View file @
713dd66b
...
...
@@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define CURRENT_VERSION "LabComm2014
1009
"
#define CURRENT_VERSION "LabComm2014"
#include <errno.h>
#include "labcomm.h"
...
...
lib/csharp/se/lth/control/labcomm/Constant.cs
View file @
713dd66b
...
...
@@ -2,7 +2,7 @@ namespace se.lth.control.labcomm {
public
class
Constant
{
public
const
string
CURRENT_VERSION
=
"LabComm2014
1009
"
;
public
const
string
CURRENT_VERSION
=
"LabComm2014"
;
/*
* Allowed packet tags
...
...
lib/java/Makefile
View file @
713dd66b
...
...
@@ -14,13 +14,13 @@ MODULES=Constant \
Writer
\
WriterWrapper
all
:
labcomm.jar labcomm2014
1009
.jar labcomm2006.jar
all
:
labcomm.jar labcomm2014.jar labcomm2006.jar
labcomm.jar
:
gen/JAVAC
echo
$@
cd
gen
;
jar cf ../
$@
se/lth/control/labcomm/
*
.class se/lth/control/labcomm2006/
*
.class
labcomm2014
1009
.jar
:
gen/JAVAC
labcomm2014.jar
:
gen/JAVAC
echo
$@
cd
gen
;
jar cf ../
$@
se/lth/control/labcomm/
*
.class
...
...
@@ -39,5 +39,5 @@ gen/JAVAC: $(MODULES:%=se/lth/control/labcomm/%.java) $(MODULES:%=se/lth/control
.PHONY
:
clean
clean
:
rm
-rf
labcomm.jar labcomm2006.jar labcomm2014
1009
.jar gen
rm
-rf
labcomm.jar labcomm2006.jar labcomm2014.jar gen
lib/java/se/lth/control/labcomm/Constant.java
View file @
713dd66b
...
...
@@ -2,7 +2,7 @@ package se.lth.control.labcomm;
public
class
Constant
{
public
static
final
String
CURRENT_VERSION
=
"LabComm2014
1009
"
;
public
static
final
String
CURRENT_VERSION
=
"LabComm2014"
;
/*
* Allowed packet tags
...
...
lib/java/se/lth/control/labcomm2006/DecoderChannel.java
View file @
713dd66b
...
...
@@ -134,7 +134,7 @@ public class DecoderChannel implements Decoder {
}
/**
method for API harmonization with labcomm2014
1009
.
method for API harmonization with labcomm2014.
Labcomm2006 encodes lengths etc as 32 bit ints.
*/
public
int
decodePacked32
()
throws
IOException
{
...
...
lib/java/se/lth/control/labcomm2006/EncoderChannel.java
View file @
713dd66b
...
...
@@ -81,7 +81,7 @@ public class EncoderChannel implements Encoder {
}
/**
method for API harmonization with labcomm2014
1009
.
method for API harmonization with labcomm2014.
Labcomm2006 encodes lengths etc as 32 bit ints.
*/
public
void
encodePacked32
(
long
value
)
throws
IOException
{
...
...
lib/python/labcomm/LabComm.py
View file @
713dd66b
#!/usr/bin/python
#
# LabComm2014
1009
packet has the following layout
# LabComm2014 packet has the following layout
#
# +----+----+----+----+
# | id (packed32)
...
...
@@ -11,7 +11,7 @@
# | ...
# +----+--
#
# LabComm2
2
014
1009
SAMPLE
_DEF
:
# LabComm2014 SAMPLE:
#
# +----+----+----+----+
# | id = 0x02 (packed32)
...
...
@@ -29,7 +29,7 @@
# | ...
# +----+--
#
# LabComm2
2
014
1009
TYPE_DEF: (as SAMPLE_DEF, but signatures are hierarchical,
# LabComm2014 TYPE_DEF: (as SAMPLE_DEF, but signatures are hierarchical,
# i.e., may contain references to other types
#
# +----+----+----+----+
...
...
@@ -48,7 +48,7 @@
# | ...
# +----+--
#
# LabComm2
2
014
1009
TYPE_BINDING
# LabComm2014 TYPE_BINDING
#
# +----+----+----+----+
# | id = 0x04 (packed32)
...
...
@@ -60,7 +60,7 @@
# | type number (packed32)
# +----+----+----+----+
#
# LabComm2014
1009
User data:
# LabComm2014 User data:
#
# +----+----+----+----+
# | id >= 0x00000040 (packed32)
...
...
@@ -151,7 +151,7 @@
import
types
import
struct
as
packer
DEFAULT_VERSION
=
"LabComm2014
1009
"
DEFAULT_VERSION
=
"LabComm2014"
# Allowed packet tags
i_VERSION
=
0x01
...
...
@@ -177,7 +177,7 @@ i_STRING = 0x27
# Version testing
def
usePacketLength
(
version
):
return
version
in
[
None
,
"LabComm2014
1009
"
]
return
version
in
[
None
,
"LabComm2014"
]
class
length_encoder
:
def
__init__
(
self
,
encoder
):
...
...
@@ -619,7 +619,7 @@ class Encoder(Codec):
super
(
Encoder
,
self
).
__init__
()
self
.
writer
=
writer
self
.
version
=
version
if
self
.
version
in
[
"LabComm2014
1009
"
]:
if
self
.
version
in
[
"LabComm2014"
]:
self
.
encode_type
(
i_VERSION
)
with
length_encoder
(
self
)
as
e
:
e
.
encode_string
(
version
)
...
...
@@ -654,7 +654,7 @@ class Encoder(Codec):
decl
.
encode_decl
(
self
)
def
encode_packed32
(
self
,
v
):
if
self
.
version
in
[
None
,
"LabComm2014
1009
"
]:
if
self
.
version
in
[
None
,
"LabComm2014"
]:
v
=
v
&
0xffffffff
tmp
=
[
v
&
0x7f
]
v
=
v
>>
7
...
...
@@ -771,7 +771,7 @@ class Decoder(Codec):
return
result
def
decode_packed32
(
self
):
if
self
.
version
in
[
"LabComm2013"
,
"LabComm2014
1009
"
]
:
if
self
.
version
in
[
"LabComm2013"
,
"LabComm2014"
]
:
result
=
0
while
True
:
tmp
=
self
.
decode_byte
()
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment