Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
e203e571
Commit
e203e571
authored
4 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
feat(mp-ble): Allow to read mac address
parent
e25f56c2
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!446
Initial MicroPython BLE support (GATTS)
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
epicardium/ble/ble.c
+8
-1
8 additions, 1 deletion
epicardium/ble/ble.c
epicardium/epicardium.h
+2
-0
2 additions, 0 deletions
epicardium/epicardium.h
pycardium/modules/modbluetooth_card10.c
+1
-1
1 addition, 1 deletion
pycardium/modules/modbluetooth_card10.c
with
11 additions
and
2 deletions
epicardium/ble/ble.c
+
8
−
1
View file @
e203e571
...
...
@@ -30,6 +30,9 @@ struct log_packet_header {
uint32_t
timestamp_us_h
;
uint32_t
timestamp_us_l
;
};
static
uint8_t
bdAddr
[
6
]
=
{
0xCA
,
0x4D
,
0x10
,
0x00
,
0x00
,
0x00
};
static
const
uint8_t
log_header
[]
=
{
'b'
,
't'
,
's'
,
'n'
,
'o'
,
'o'
,
'p'
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0x03
,
0xea
};
...
...
@@ -178,7 +181,6 @@ static void WsfInit(void)
/* TODO: We need a source of MACs */
static
void
setAddress
(
void
)
{
uint8_t
bdAddr
[
6
]
=
{
0xCA
,
0x4D
,
0x10
,
0x00
,
0x00
,
0x00
};
char
buf
[
32
];
int
result
=
epic_config_get_string
(
"ble_mac"
,
buf
,
sizeof
(
buf
));
...
...
@@ -222,6 +224,11 @@ static void setAddress(void)
HciVsSetBdAddr
(
bdAddr
);
}
/*************************************************************************************************/
void
epic_ble_get_address
(
uint8_t
*
addr
)
{
memcpy
(
addr
,
bdAddr
,
sizeof
(
bdAddr
));
}
/*************************************************************************************************/
static
void
vTimerCallback
(
xTimerHandle
pxTimer
)
{
//printf("wake\n");
...
...
This diff is collapsed.
Click to expand it.
epicardium/epicardium.h
+
2
−
0
View file @
e203e571
...
...
@@ -177,6 +177,7 @@ typedef _Bool bool;
#define API_BLE_GET_ATT_WRITE 0x1BD
#define API_BLE_FREE_ATT_WRITE 0x1BE
#define API_BLE_ATTS_DYN_ADD_CHARACTERISTIC 0x1BF
#define API_BLE_GET_ADDRESS 0x174
/* clang-format on */
...
...
@@ -2605,6 +2606,7 @@ API(API_BLE_ATTS_SET_BUFFER, int epic_ble_atts_set_buffer(uint16_t value_handle,
API
(
API_BLE_FREE_EVENT
,
int
epic_ble_free_event
(
struct
epic_ble_event
*
e
));
API
(
API_BLE_GET_ADDRESS
,
void
epic_ble_get_address
(
uint8_t
*
addr
));
#endif
/* _EPICARDIUM_H */
This diff is collapsed.
Click to expand it.
pycardium/modules/modbluetooth_card10.c
+
1
−
1
View file @
e203e571
...
...
@@ -327,7 +327,7 @@ bool mp_bluetooth_is_active(void)
// Gets the MAC addr of this device in big-endian format.
void
mp_bluetooth_get_device_addr
(
uint8_t
*
addr
)
{
raise
(
);
epic_ble_get_address
(
addr
);
}
size_t
mp_bluetooth_gap_get_device_name
(
const
uint8_t
**
buf
)
...
...
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