Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PolyORB-HI-C
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
PolyORB-HI-C
Commits
edfb2899
Commit
edfb2899
authored
Mar 02, 2020
by
Jerome Hugues
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Added Bluetooth configuration from TASTE
parent
0e86b129
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
13 deletions
+155
-13
src/drivers/configuration/Makefile.am
src/drivers/configuration/Makefile.am
+15
-13
src/drivers/configuration/bluetooth.asn
src/drivers/configuration/bluetooth.asn
+21
-0
src/drivers/configuration/bluetooth.c
src/drivers/configuration/bluetooth.c
+119
-0
No files found.
src/drivers/configuration/Makefile.am
View file @
edfb2899
AUTOMAKE_OPTIONS
=
no-dependencies
C_FILES
=
$(srcdir)
/1553.c
\
$(srcdir)
/ip.c
\
$(srcdir)
/serial.c
\
$(srcdir)
/spacewire.c
ASN_FILES
=
$(srcdir)
/1553.asn
\
$(srcdir)
/ip.asn
\
$(srcdir)
/serial.asn
\
$(srcdir)
/spacewire.asn
C_FILES
=
$(srcdir)
/1553.c
$(srcdir)
/ip.c
$(srcdir)
/serial.c
\
$(srcdir)
/spacewire.c
$(srcdir)
/bluetooth.c
ASN_FILES
=
$(srcdir)
/1553.asn
$(srcdir)
/ip.asn
$(srcdir)
/serial.asn
\
$(srcdir)
/spacewire.asn
$(srcdir)
/bluetooth.asn
csrc
=
${
shell
$(CYGPATH_U)
'
$(OCARINA_RUNTIME)
/polyorb-hi-c/src/drivers/configuration'
}
t
:
echo
$(
shell
shell which asn1.exe
)
echo
`
shell which asn1.exe
`
$(srcdir)/1553.c
:
mono
$(
shell
which asn1.exe
)
-c
-typePrefix
__po_hi_c_ 1553.asn
sed
-e
's/Mil\_1553\_Conf\_T/mil\_1553\_conf\_t/g'
1553.h
>
1553new.h
...
...
@@ -61,6 +52,17 @@ $(srcdir)/serial.c:
mv
serial.h ../../../include/drivers/configuration/
mv
asn1crt.h ../../../include/drivers/configuration/
$(srcdir)/bluetooth.c
:
mono
$$
(
which asn1.exe
)
-c
-typePrefix
__po_hi_c_ bluetooth.asn
sed
-e
's/Bluetooth\_Conf\_T/bluetooth\_conf\_t/g'
bluetooth.h
>
bluetoothnew.h
mv
bluetoothnew.h bluetooth.h
echo
"#if (defined (__PO_HI_NEED_DRIVER_BLUETOOTH))
\n
"
>
bluetoothnew.c
sed
-e
's/Bluetooth\_Conf\_T/bluetooth\_conf\_t/g'
bluetooth.c
>>
bluetoothnew.c
echo
"
\n
#endif"
>>
bluetoothnew.c
mv
bluetoothnew.c bluetooth.c
mv
bluetooth.h ../../../include/drivers/configuration/
mv
asn1crt.h ../../../include/drivers/configuration/
regenerate
:
rm
-f
$(C_FILES)
for
v
in
$(C_FILES)
;
do
$(MAKE)
$$
v
;
done
...
...
src/drivers/configuration/bluetooth.asn
0 → 100644
View file @
edfb2899
POHICDRIVER-BLUETOOTH DEFINITIONS AUTOMATIC TAGS ::= BEGIN
Datarate-T ::= ENUMERATED {d250K, d1M, d2M}
Address-T ::= OCTET STRING (SIZE (5))
Bluetooth-Conf-T ::= SEQUENCE {
channel INTEGER (0..125),
datarate Datarate-T DEFAULT d2M,
address Address-T DEFAULT 'E7E7E7E7E7'H
}
crazyflie-default Bluetooth-Conf-T ::= {
channel 80,
datarate d2M,
address 'E7E7E7E7E7'H
}
END
src/drivers/configuration/bluetooth.c
0 → 100644
View file @
edfb2899
#if (defined (__PO_HI_NEED_DRIVER_BLUETOOTH))\n
/*
Code automatically generated by asn1scc tool
*/
#include <limits.h>
#include <string.h>
#include <math.h>
#include "bluetooth.h"
const
__po_hi_c_bluetooth_conf_t
crazyflie_default
=
{
.
channel
=
80
,
.
datarate
=
__po_hi_c_d2M
,
.
address
=
{
{
0xE7
,
0xE7
,
0xE7
,
0xE7
,
0xE7
}
},
.
exist
=
{
.
datarate
=
1
,
.
address
=
1
}
};
void
__po_hi_c_Datarate_T_Initialize
(
__po_hi_c_Datarate_T
*
pVal
)
{
(
void
)
pVal
;
(
*
(
pVal
))
=
__po_hi_c_d250K
;
}
flag
__po_hi_c_Datarate_T_IsConstraintValid
(
const
__po_hi_c_Datarate_T
*
pVal
,
int
*
pErrCode
)
{
flag
ret
=
TRUE
;
(
void
)
pVal
;
ret
=
((((((
*
(
pVal
))
==
__po_hi_c_d250K
))
||
(((
*
(
pVal
))
==
__po_hi_c_d1M
))))
||
(((
*
(
pVal
))
==
__po_hi_c_d2M
)));
*
pErrCode
=
ret
?
0
:
ERR_DATARATE_T
;
return
ret
;
}
void
__po_hi_c_Address_T_Initialize
(
__po_hi_c_Address_T
*
pVal
)
{
(
void
)
pVal
;
memset
(
pVal
->
arr
,
0x0
,
5
);
}
flag
__po_hi_c_Address_T_IsConstraintValid
(
const
__po_hi_c_Address_T
*
pVal
,
int
*
pErrCode
)
{
flag
ret
=
TRUE
;
(
void
)
pVal
;
ret
=
TRUE
;
*
pErrCode
=
0
;
return
ret
;
}
void
__po_hi_c_bluetooth_conf_t_channel_Initialize
(
__po_hi_c_bluetooth_conf_t_channel
*
pVal
)
{
(
void
)
pVal
;
(
*
(
pVal
))
=
0
;
}
void
__po_hi_c_bluetooth_conf_t_Initialize
(
__po_hi_c_bluetooth_conf_t
*
pVal
)
{
(
void
)
pVal
;
/*set channel */
__po_hi_c_bluetooth_conf_t_channel_Initialize
((
&
(
pVal
->
channel
)));
/*set datarate */
pVal
->
exist
.
datarate
=
1
;
pVal
->
datarate
=
__po_hi_c_d2M
;
/*set address */
pVal
->
exist
.
address
=
1
;
pVal
->
address
.
arr
[
0
]
=
0xe7
;
pVal
->
address
.
arr
[
1
]
=
0xe7
;
pVal
->
address
.
arr
[
2
]
=
0xe7
;
pVal
->
address
.
arr
[
3
]
=
0xe7
;
pVal
->
address
.
arr
[
4
]
=
0xe7
;
}
flag
__po_hi_c_bluetooth_conf_t_IsConstraintValid
(
const
__po_hi_c_bluetooth_conf_t
*
pVal
,
int
*
pErrCode
)
{
flag
ret
=
TRUE
;
(
void
)
pVal
;
ret
=
(
pVal
->
channel
<=
125UL
);
*
pErrCode
=
ret
?
0
:
ERR_BLUETOOTH_CONF_T_CHANNEL
;
if
(
ret
)
{
if
(
pVal
->
exist
.
datarate
)
{
ret
=
(((((
pVal
->
datarate
==
__po_hi_c_d250K
))
||
((
pVal
->
datarate
==
__po_hi_c_d1M
))))
||
((
pVal
->
datarate
==
__po_hi_c_d2M
)));
*
pErrCode
=
ret
?
0
:
ERR_BLUETOOTH_CONF_T_DATARATE
;
}
}
return
ret
;
}
\
n
#
endif
Write
Preview
Markdown
is supported
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