[Pkg-running-devel] [openambit] 111/131: Added support for latest firmware versions (2.0.9) Fixes #42
Christian Perrier
bubulle at moszumanska.debian.org
Thu Jul 17 20:19:16 UTC 2014
This is an automated email from the git hooks/post-receive script.
bubulle pushed a commit to branch master
in repository openambit.
commit 95298f8fdbba1dbaaa53db2150f51af85df135f1
Author: Emil Ljungdahl <emil at kratern.se>
Date: Tue May 27 21:44:26 2014 +0200
Added support for latest firmware versions (2.0.9)
Fixes #42
---
src/libambit/libambit.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/libambit/libambit.c b/src/libambit/libambit.c
index 995d3ec..a7a00eb 100644
--- a/src/libambit/libambit.c
+++ b/src/libambit/libambit.c
@@ -74,6 +74,8 @@ static ambit_known_device_t known_devices[] = {
{ 0x0000, 0x0000, NULL, {0x00,0x00,0x00,0x00}, NULL, false }
};
+static uint8_t komposti_version[] = { 0x01, 0x08, 0x01, 0x00 };
+
/*
* Public functions
*/
@@ -295,7 +297,7 @@ int libambit_gps_orbit_header_read(ambit_object_t *object, uint8_t data[8])
size_t replylen = 0;
int ret = -1;
- if (libambit_protocol_command(object, ambit_command_gps_orbit_head, NULL, 0, &reply_data, &replylen, 0) == 0 && replylen == 9) {
+ if (libambit_protocol_command(object, ambit_command_gps_orbit_head, NULL, 0, &reply_data, &replylen, 0) == 0 && replylen >= 9) {
memcpy(data, &reply_data[1], 8);
libambit_protocol_free(reply_data);
@@ -507,14 +509,13 @@ void libambit_log_entry_free(ambit_log_entry_t *log_entry)
static int device_info_get(ambit_object_t *object, ambit_device_info_t *info)
{
- uint8_t send_data[] = { 0x01, 0x06, 0x14, 0x00 };
uint8_t *reply_data = NULL;
size_t replylen;
int ret = -1;
LOG_INFO("Reading device info");
- if (libambit_protocol_command(object, ambit_command_device_info, send_data, sizeof(send_data), &reply_data, &replylen, 1) == 0) {
+ if (libambit_protocol_command(object, ambit_command_device_info, komposti_version, sizeof(komposti_version), &reply_data, &replylen, 1) == 0) {
if (info != NULL) {
memcpy(info->model, reply_data, 16);
info->model[16] = 0;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/openambit.git
More information about the Pkg-running-devel
mailing list