Skip to content

Commit 68f788e

Browse files
author
Maarten Pennings
committed
0.5.0
- Added error `aoresult_dev_i2cmode` and `aoresult_osp_argsize` to better support I2C in modes 8 and 12. - Added link to examples.
1 parent 2dda9e1 commit 68f788e

File tree

4 files changed

+30
-22
lines changed

4 files changed

+30
-22
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=OSP ResultCodes aoresult
2-
version=0.4.6
2+
version=0.5.0
33
author=ams-OSRAM
44
maintainer=ams-OSRAM
55
sentence=A library that defines all error codes that may occur in any of the OSP libraries.

readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ in a separate library _aoresult_ makes sense.
2828

2929
This library comes with the following examples.
3030
You can find them in the Arduino IDE via
31-
File > Examples > OSP ResultCodes aoresult > ...
31+
[File > Examples > OSP ResultCodes aoresult > ...](examples):
3232

3333
- **aoresult_demo** ([source](examples/aoresult_demo))
3434
This demo shows how to convert the result codes from the aoresult lib
@@ -59,9 +59,13 @@ Here is a quick overview:
5959

6060
## Version history _aoresult_
6161

62+
- **2025 September 16, 0.5.0**
63+
- Added error `aoresult_dev_i2cmode` and `aoresult_osp_argsize` to better support I2C in modes 8 and 12.
64+
- Added link to examples.
65+
6266
- **2025 April 22, 0.4.6**
6367
- Made `aoresult.h` self contained: added `#include <Arduino.h>` for `Serial` in `AORESULT_ASSERT()`.
64-
68+
6569
- **2024 November 29, 0.4.5**
6670
- Added error `aoresult_osp_nosr` for missing acknowledge.
6771
- Small updates in `aoresult_demo.ino`.

src/aoresult.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// aoresult.cpp - list of all error codes in any of the aolibs.
22
/*****************************************************************************
3-
* Copyright 2024 by ams OSRAM AG *
3+
* Copyright 2024,2025 by ams OSRAM AG *
44
* All rights are reserved. *
55
* *
66
* IMPORTANT - PLEASE READ CAREFULLY BEFORE COPYING, INSTALLING OR USING *
@@ -48,7 +48,8 @@ const char * aoresult_to_str(aoresult_t result, int verbose) {
4848
case aoresult_spi_noclock : return verbose==0 ? "spi_noclock" : "No clock signal detected for response telegram";
4949
case aoresult_spi_length : return verbose==0 ? "spi_length" : "Response telegram length differs from requested";
5050

51-
case aoresult_osp_arg : return verbose==0 ? "osp_arg" : "An OSP telegram argument has an illegal value";
51+
case aoresult_osp_arg : return verbose==0 ? "osp_arg" : "An OSP telegram argument has an illegal (out of range) value";
52+
case aoresult_osp_argsize : return verbose==0 ? "osp_argsize" : "An OSP telegram (buf) argument causes illegal telegram size";
5253
case aoresult_osp_addr : return verbose==0 ? "osp_addr" : "The address for an OSP telegram is illegal";
5354
case aoresult_osp_preamble : return verbose==0 ? "osp_preamble" : "Preamble incorrect in response telegram";
5455
case aoresult_osp_tid : return verbose==0 ? "osp_tid" : "Unexpected telegram ID in response telegram";
@@ -66,6 +67,7 @@ const char * aoresult_to_str(aoresult_t result, int verbose) {
6667
case aoresult_dev_noi2cdev : return verbose==0 ? "dev_noi2cdev" : "Missing specific I2C device (eg app needs EEPROM or I/O-expander)";
6768
case aoresult_dev_i2ctimeout : return verbose==0 ? "dev_i2ctimeout" : "I2C transaction took too long to complete";
6869
case aoresult_dev_i2cnack : return verbose==0 ? "dev_i2cnack" : "I2C transaction completed with NACK";
70+
case aoresult_dev_i2cmode : return verbose==0 ? "dev_i2cmode" : "I2C telegram not compatible with (8 or12 bit) mode";
6971

7072
case aoresult_numresultcodes : return verbose==0 ? "<illegal>" : "Illegal error code aoresult_numresultcodes";
7173
}

src/aoresult.h

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
// Identifies lib version
29-
#define AORESULT_VERSION "0.4.6"
29+
#define AORESULT_VERSION "0.5.0"
3030

3131

3232
// For detailed meaning, see aoresult_to_str()
@@ -46,27 +46,29 @@ typedef enum aoresult_e {
4646

4747
// Errors for aoosp
4848
aoresult_osp_arg , // 9
49-
aoresult_osp_addr , // 10
50-
aoresult_osp_preamble , // 11
51-
aoresult_osp_tid , // 12
52-
aoresult_osp_size , // 13
53-
aoresult_osp_psi , // 14
54-
aoresult_osp_crc , // 15
55-
aoresult_osp_nosr , // 16
49+
aoresult_osp_argsize , // 10
50+
aoresult_osp_addr , // 11
51+
aoresult_osp_preamble , // 12
52+
aoresult_osp_tid , // 13
53+
aoresult_osp_size , // 14
54+
aoresult_osp_psi , // 15
55+
aoresult_osp_crc , // 16
56+
aoresult_osp_nosr , // 17
5657

5758
// Errors on OSP system
58-
aoresult_sys_cabling , // 17
59-
aoresult_sys_id , // 18
60-
aoresult_sys_wrongtopo , // 19
61-
aoresult_sys_nodecfg , // 20
59+
aoresult_sys_cabling , // 18
60+
aoresult_sys_id , // 19
61+
aoresult_sys_wrongtopo , // 20
62+
aoresult_sys_nodecfg , // 21
6263

6364
// Errors for attached devices
64-
aoresult_dev_noi2cbridge , // 21
65-
aoresult_dev_noi2cdev , // 22
66-
aoresult_dev_i2ctimeout , // 23
67-
aoresult_dev_i2cnack , // 24
65+
aoresult_dev_noi2cbridge , // 22
66+
aoresult_dev_noi2cdev , // 23
67+
aoresult_dev_i2ctimeout , // 24
68+
aoresult_dev_i2cnack , // 25
69+
aoresult_dev_i2cmode , // 26
6870

69-
aoresult_numresultcodes // 25 keep this as last
71+
aoresult_numresultcodes // 27 keep this as last
7072
} aoresult_t;
7173

7274

0 commit comments

Comments
 (0)