Skip to content

Commit

Permalink
Merge pull request MikroElektronika#45 from MikroElektronika/stefan.f…
Browse files Browse the repository at this point in the history
…ilipovic/19week2023

sync click boards to week 19 of 2023
  • Loading branch information
StefanFilipovic15 authored May 12, 2023
2 parents 55f8ec1 + cf050d6 commit 91f0f8a
Show file tree
Hide file tree
Showing 488 changed files with 36,338 additions and 19,080 deletions.
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

**Updates by date of commit:**

+ **[20230512](#20230512)**
+ **[20230505](#20230505)**
+ **[20230428](#20230428)**
+ **[20230421](#20230421)**
Expand Down Expand Up @@ -47,6 +48,58 @@
---
---

## `20230512`

*Following click boards have been added:*

+ `DC Motor 26`
+ `Ambient 23`
+ `N-PLC`
+ `CO2 3`

*Following click boards have been updated:*

+ `Accel 18`
+ `Accel`
+ `ADC 13`
+ `ADC 6`
+ `AD-SWIO`
+ `Air quality 7`
+ `Altitude 2`
+ `AM/FM`
+ `Ambient 9`
+ `ATA663211`
+ `AudioAmp 8`
+ `BATT-MAN 3`
+ `BEE`
+ `BLE 9`
+ `4G LTE 2 Voice`
+ `4G LTE-E`
+ `4G LTE-APJ`
+ `4G LTE-ATT`
+ `4G LTE-NA`
+ `Analog MUX 4`
+ `Analog MUX 5`
+ `BATT-MON 4`
+ `Counter`
+ `DC Motor 18`
+ `DC Motor 22`
+ `Expand 14`
+ `Hall Current 4`
+ `Hall Current 6`
+ `Hall Switch`
+ `HAPTIC 3`
+ `Heart Rate 11`
+ `LTE Cat.1-US`
+ `LTE IoT 3`
+ `MCP2542`
+ `Shuttle`
+ `TFmini`

**[BACK TO TOP](#changelog)**

---

## `20230505`

*Following click boards have been added:*
Expand Down
648 changes: 325 additions & 323 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clicks/4glte2voice/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Changelog

### Version 2.1.0.4
### Version 2.1.0.5
- Initial release
3 changes: 2 additions & 1 deletion clicks/4glte2voice/doc/package/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"supported_compiler": "mikroC AI|GCC",
"type": "Library",
"_type":"mikroSDK Library",
"version": "2.1.0.4",
"version": "2.1.0.5",
"cmake": true,
"alias": "Click.4GLTE2Voice",
"subdir_name": "lib_c4glte2voice"
Expand All @@ -37,3 +37,4 @@




6 changes: 3 additions & 3 deletions clicks/4glte2voice/example/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
#define DEMO_EXAMPLE EXAMPLE_TCP_UDP // Example selection macro

// SIM APN config
#define SIM_APN "internet" // Set valid SIM APN
#define SIM_APN "" // Set valid SIM APN

// SMS example parameters
#define SIM_SMSC "+381610401" // Set valid SMS Service Center Address - only in SMS PDU mode
#define PHONE_NUMBER_TO_MESSAGE "+381655358725" // Set Phone number to message
#define SIM_SMSC "" // Set valid SMS Service Center Address - only in SMS PDU mode
#define PHONE_NUMBER_TO_MESSAGE "" // Set Phone number to message
#define SMS_MODE "1" // SMS mode: "0" - PDU, "1" - TXT

// TCP/UDP example parameters
Expand Down
2 changes: 1 addition & 1 deletion clicks/4glteapj/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Changelog

### Version 2.1.0.4
### Version 2.1.0.5
- Initial release
3 changes: 2 additions & 1 deletion clicks/4glteapj/doc/package/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"supported_compiler": "mikroC AI|GCC",
"type": "Library",
"_type": "mikroSDK Library",
"version": "2.1.0.4",
"version": "2.1.0.5",
"cmake": true,
"alias": "Click.4GLTEAPJ",
"subdir_name": "lib_c4glteapj"
}

63 changes: 47 additions & 16 deletions clicks/4glteapj/lib_c4glteapj/src/c4glteapj.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint
*/
static int16_t encode_phone_number ( char *phone_number, uint8_t *output_buffer, uint16_t buffer_size );

/**
* @brief 4G-LTE-APJ str cut chr function.
* @details This function removes all selected characters from string str,
* and returns it to the same str without those characters.
* @param str Address of string.
* @param chr Character to cut.
*/
static void c4glteapj_str_cut_chr ( uint8_t *str, uint8_t chr );

// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS

void c4glteapj_cfg_setup ( c4glteapj_cfg_t *cfg ) {
Expand Down Expand Up @@ -266,25 +275,29 @@ void c4glteapj_send_sms_text ( c4glteapj_t *ctx, char *phone_number, char *sms_t
}

err_t c4glteapj_send_sms_pdu ( c4glteapj_t *ctx, char *service_center_number, char *phone_number, char *sms_text ) {
char text[ SMS_MAX_PDU_LENGTH ] = { 0 };
char pdu_buf[ SMS_MAX_PDU_LENGTH ] = { 0 };
char byte_buf[ 4 ] = { 0 };
char ctrl_z[ ] = { 26, 0 };
int16_t pdu_buf_len;
uint8_t length;

str_cut_chr ( service_center_number, '+' );
str_cut_chr ( phone_number, '+' );
uint8_t text[ SMS_MAX_PDU_LENGTH ] = { 0 };
uint8_t pdu_buf[ SMS_MAX_PDU_LENGTH ] = { 0 };
uint8_t byte_buf[ 4 ] = { 0 };
uint8_t ctrl_z[ 2 ] = { 26, 0 };
int16_t pdu_buf_len = 0;
uint8_t length = 0;
uint8_t smsc[ 32 ] = { 0 };
uint8_t phone_num[ 32 ] = { 0 };
strcpy ( smsc, service_center_number );
strcpy ( phone_num, phone_number );
c4glteapj_str_cut_chr ( smsc, '+' );
c4glteapj_str_cut_chr ( phone_num, '+' );

pdu_buf_len = pdu_encode( service_center_number, phone_number, sms_text, pdu_buf, SMS_MAX_PDU_LENGTH );
pdu_buf_len = pdu_encode( smsc, phone_num, sms_text, pdu_buf, SMS_MAX_PDU_LENGTH );

if ( pdu_buf_len < 0 ) {
if ( pdu_buf_len < 0 )
{
return C4GLTEAPJ_ERROR;
}

length = pdu_buf_len - ( ( strlen( service_center_number ) - 1 ) / 2 + 3 );
length = pdu_buf_len - ( ( strlen( smsc ) - 1 ) / 2 + 3 );
uint8_to_str( length, byte_buf );
str_cut_chr ( byte_buf, ' ');
c4glteapj_str_cut_chr ( byte_buf, ' ' );

strcpy( text, C4GLTEAPJ_CMD_CMGS );
strcat( text, "=" );
Expand All @@ -293,7 +306,8 @@ err_t c4glteapj_send_sms_pdu ( c4glteapj_t *ctx, char *service_center_number, ch
c4glteapj_send_cmd( ctx, text );
memset( text, 0, SMS_MAX_PDU_LENGTH );

for ( int16_t cnt = 0; cnt < pdu_buf_len; cnt++ ) {
for ( int16_t cnt = 0; cnt < pdu_buf_len; cnt++ )
{
uint8_to_hex ( pdu_buf[ cnt ], byte_buf );
strcat ( text, byte_buf );
}
Expand Down Expand Up @@ -377,7 +391,8 @@ static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint
int16_t i = 0;

for ( ; i < sms_text_length - 1; ++i ) {
output_buffer[ output_buffer_length++ ] = ( ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ) ) | ( ( sms_text[ i + 1 ] & BITMASK_7BITS ) << ( 8 - carry_on_bits ) );
output_buffer[ output_buffer_length++ ] = ( ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ) ) |
( ( sms_text[ i + 1 ] & BITMASK_7BITS ) << ( 8 - carry_on_bits ) );
carry_on_bits++;
if ( carry_on_bits == 8 ) {
carry_on_bits = 1;
Expand Down Expand Up @@ -411,11 +426,27 @@ static int16_t encode_phone_number ( char *phone_number, uint8_t *output_buffer,
if ( i % 2 == 0 ) {
output_buffer[ output_buffer_length++ ] = BITMASK_HIGH_4BITS | ( phone_number[ i ] - '0' );
} else {
output_buffer[ output_buffer_length - 1 ] = ( output_buffer[ output_buffer_length - 1 ] & BITMASK_LOW_4BITS ) | ( ( phone_number[ i ] - '0' ) << 4 );
output_buffer[ output_buffer_length - 1 ] = ( output_buffer[ output_buffer_length - 1 ] & BITMASK_LOW_4BITS ) |
( ( phone_number[ i ] - '0' ) << 4 );
}
}

return output_buffer_length;
}

static void c4glteapj_str_cut_chr ( uint8_t *str, uint8_t chr )
{
uint16_t cnt_0, cnt_1;
for ( cnt_0 = 0; cnt_0 < strlen( str ); cnt_0++ )
{
if ( str[ cnt_0 ] == chr )
{
for ( cnt_1 = cnt_0; cnt_1 < strlen( str ); cnt_1++ )
{
str[ cnt_1 ] = str[ cnt_1 + 1 ];
}
}
}
}

// ------------------------------------------------------------------------- END
2 changes: 1 addition & 1 deletion clicks/4glteatt/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Changelog

### Version 2.1.0.4
### Version 2.1.0.5
- Initial release
3 changes: 2 additions & 1 deletion clicks/4glteatt/doc/package/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"supported_compiler": "mikroC AI|GCC",
"type": "Library",
"_type": "mikroSDK Library",
"version": "2.1.0.4",
"version": "2.1.0.5",
"cmake": true,
"alias": "Click.4GLTEATT",
"subdir_name": "lib_c4glteatt"
}

63 changes: 47 additions & 16 deletions clicks/4glteatt/lib_c4glteatt/src/c4glteatt.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint
*/
static int16_t encode_phone_number ( char *phone_number, uint8_t *output_buffer, uint16_t buffer_size );

/**
* @brief 4G-LTE-ATT str cut chr function.
* @details This function removes all selected characters from string str,
* and returns it to the same str without those characters.
* @param str Address of string.
* @param chr Character to cut.
*/
static void c4glteatt_str_cut_chr ( uint8_t *str, uint8_t chr );

// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS

void c4glteatt_cfg_setup ( c4glteatt_cfg_t *cfg ) {
Expand Down Expand Up @@ -266,25 +275,29 @@ void c4glteatt_send_sms_text ( c4glteatt_t *ctx, char *phone_number, char *sms_t
}

err_t c4glteatt_send_sms_pdu ( c4glteatt_t *ctx, char *service_center_number, char *phone_number, char *sms_text ) {
char text[ SMS_MAX_PDU_LENGTH ] = { 0 };
char pdu_buf[ SMS_MAX_PDU_LENGTH ] = { 0 };
char byte_buf[ 4 ] = { 0 };
char ctrl_z[ ] = { 26, 0 };
int16_t pdu_buf_len;
uint8_t length;

str_cut_chr ( service_center_number, '+' );
str_cut_chr ( phone_number, '+' );
uint8_t text[ SMS_MAX_PDU_LENGTH ] = { 0 };
uint8_t pdu_buf[ SMS_MAX_PDU_LENGTH ] = { 0 };
uint8_t byte_buf[ 4 ] = { 0 };
uint8_t ctrl_z[ 2 ] = { 26, 0 };
int16_t pdu_buf_len = 0;
uint8_t length = 0;
uint8_t smsc[ 32 ] = { 0 };
uint8_t phone_num[ 32 ] = { 0 };
strcpy ( smsc, service_center_number );
strcpy ( phone_num, phone_number );
c4glteatt_str_cut_chr ( smsc, '+' );
c4glteatt_str_cut_chr ( phone_num, '+' );

pdu_buf_len = pdu_encode( service_center_number, phone_number, sms_text, pdu_buf, SMS_MAX_PDU_LENGTH );
pdu_buf_len = pdu_encode( smsc, phone_num, sms_text, pdu_buf, SMS_MAX_PDU_LENGTH );

if ( pdu_buf_len < 0 ) {
if ( pdu_buf_len < 0 )
{
return C4GLTEATT_ERROR;
}

length = pdu_buf_len - ( ( strlen( service_center_number ) - 1 ) / 2 + 3 );
length = pdu_buf_len - ( ( strlen( smsc ) - 1 ) / 2 + 3 );
uint8_to_str( length, byte_buf );
str_cut_chr ( byte_buf, ' ');
c4glteatt_str_cut_chr ( byte_buf, ' ' );

strcpy( text, C4GLTEATT_CMD_CMGS );
strcat( text, "=" );
Expand All @@ -293,7 +306,8 @@ err_t c4glteatt_send_sms_pdu ( c4glteatt_t *ctx, char *service_center_number, ch
c4glteatt_send_cmd( ctx, text );
memset( text, 0, SMS_MAX_PDU_LENGTH );

for ( int16_t cnt = 0; cnt < pdu_buf_len; cnt++ ) {
for ( int16_t cnt = 0; cnt < pdu_buf_len; cnt++ )
{
uint8_to_hex ( pdu_buf[ cnt ], byte_buf );
strcat ( text, byte_buf );
}
Expand Down Expand Up @@ -377,7 +391,8 @@ static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint
int16_t i = 0;

for ( ; i < sms_text_length - 1; ++i ) {
output_buffer[ output_buffer_length++ ] = ( ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ) ) | ( ( sms_text[ i + 1 ] & BITMASK_7BITS ) << ( 8 - carry_on_bits ) );
output_buffer[ output_buffer_length++ ] = ( ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ) ) |
( ( sms_text[ i + 1 ] & BITMASK_7BITS ) << ( 8 - carry_on_bits ) );
carry_on_bits++;
if ( carry_on_bits == 8 ) {
carry_on_bits = 1;
Expand Down Expand Up @@ -411,11 +426,27 @@ static int16_t encode_phone_number ( char *phone_number, uint8_t *output_buffer,
if ( i % 2 == 0 ) {
output_buffer[ output_buffer_length++ ] = BITMASK_HIGH_4BITS | ( phone_number[ i ] - '0' );
} else {
output_buffer[ output_buffer_length - 1 ] = ( output_buffer[ output_buffer_length - 1 ] & BITMASK_LOW_4BITS ) | ( ( phone_number[ i ] - '0' ) << 4 );
output_buffer[ output_buffer_length - 1 ] = ( output_buffer[ output_buffer_length - 1 ] & BITMASK_LOW_4BITS ) |
( ( phone_number[ i ] - '0' ) << 4 );
}
}

return output_buffer_length;
}

static void c4glteatt_str_cut_chr ( uint8_t *str, uint8_t chr )
{
uint16_t cnt_0, cnt_1;
for ( cnt_0 = 0; cnt_0 < strlen( str ); cnt_0++ )
{
if ( str[ cnt_0 ] == chr )
{
for ( cnt_1 = cnt_0; cnt_1 < strlen( str ); cnt_1++ )
{
str[ cnt_1 ] = str[ cnt_1 + 1 ];
}
}
}
}

// ------------------------------------------------------------------------- END
2 changes: 1 addition & 1 deletion clicks/4gltee/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Changelog

### Version 2.1.0.9
### Version 2.1.0.10
- Initial release
3 changes: 2 additions & 1 deletion clicks/4gltee/doc/package/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
2058
],
"_type": "mikroSDK Library",
"version": "2.1.0.9",
"version": "2.1.0.10",
"cmake": true,
"alias": "Click.4GLTEE",
"subdir_name": "lib_c4gltee"
Expand All @@ -41,3 +41,4 @@




Loading

0 comments on commit 91f0f8a

Please sign in to comment.