Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge/template v2.5.0 #16

Merged
merged 11 commits into from
Dec 18, 2024
19 changes: 13 additions & 6 deletions .github/workflows/build_zephyr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ jobs:
uses: actions/checkout@v4
with:
path: app

- name: Process Board name
id: nicename
shell: bash
run: |
BOARD_NICENAME=${{ inputs.BOARD }}
BOARD_NICENAME=${BOARD_NICENAME//\//_}
echo "BOARD_NICENAME=${BOARD_NICENAME}" >> $GITHUB_OUTPUT

- name: Setup West workspace
run: |
west init -l app
Expand All @@ -69,17 +78,15 @@ jobs:
run: |
cd build
mkdir -p artifacts
BOARD_NICENAME=${{ inputs.BOARD }}
BOARD_NICENAME=${BOARD_NICENAME//\//_}
mv merged.hex ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${BOARD_NICENAME}_full.hex
mv app/zephyr/zephyr.signed.bin ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${BOARD_NICENAME}_update.bin
mv app/zephyr/zephyr.elf ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${BOARD_NICENAME}.elf
mv merged.hex ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${{ steps.nicename.outputs.BOARD_NICENAME }}_full.hex
mv app/zephyr/zephyr.signed.bin ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${{ steps.nicename.outputs.BOARD_NICENAME }}_update.bin
mv app/zephyr/zephyr.elf ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${{ steps.nicename.outputs.BOARD_NICENAME }}.elf

# Run IDs are unique per repo but are reused on re-runs
- name: Save artifact
if: inputs.ARTIFACT == true
uses: actions/upload-artifact@v4
with:
name: build_artifacts_${{ github.run_id }}
name: build_artifacts_${{ github.run_id }}_${{ steps.nicename.outputs.BOARD_NICENAME }}
path: |
build/artifacts/*
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build_artifacts_${{ github.run_id }}
pattern: build_artifacts_*
path: ~/artifacts
merge-multiple: true

- name: Create Release manually with GH CLI
run: gh release create --title ${{ inputs.version }} --draft ${{ inputs.version }}
Expand Down
4 changes: 2 additions & 2 deletions prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ CONFIG_GOLIOTH_STREAM=y
CONFIG_GOLIOTH_SAMPLE_COMMON=y

# Configure Golioth SDK dependencies
CONFIG_EVENTFD_MAX=14
CONFIG_ZVFS_EVENTFD_MAX=14
CONFIG_ZVFS_OPEN_MAX=23
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1536
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=10240
CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=2048
CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048
CONFIG_NETWORKING=y
CONFIG_NET_IPV4=y
CONFIG_POSIX_MAX_FDS=23

# Application
CONFIG_MAIN_STACK_SIZE=2048
Expand Down
9 changes: 4 additions & 5 deletions src/app_sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,12 @@ void user_led_set(uint8_t state)
}"

/* Callback for LightDB Stream */
static void async_error_handler(struct golioth_client *client,
const struct golioth_response *response,
const char *path,
static void async_error_handler(struct golioth_client *client, enum golioth_status status,
const struct golioth_coap_rsp_code *coap_rsp_code, const char *path,
void *arg)
{
if (response->status != GOLIOTH_OK) {
LOG_ERR("Async task failed: %d", response->status);
if (status != GOLIOTH_OK) {
LOG_ERR("Async task failed: %d", status);
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int period = 100000; /* should be 100 uSec */

static int32_t _loop_delay_s = 60;
#define LOOP_DELAY_S_MAX 43200
#define LOOP_DELAY_S_MIN 0
#define LOOP_DELAY_S_MIN 1
#define LED_FADE_SPEED_MS_MAX 10000
#define LED_FADE_SPEED_MS_MIN 500

Expand Down
25 changes: 11 additions & 14 deletions src/app_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ const char *endp_list[COUNTER_DIR_TOTAL] = {
static struct golioth_client *client;

static void async_handler(struct golioth_client *client,
const struct golioth_response *response,
const char *path,
void *arg)
enum golioth_status status,
const struct golioth_coap_rsp_code *coap_rsp_code,
const char *path,
void *arg)
{
if (response->status != GOLIOTH_OK) {
LOG_WRN("Failed to set state: %d", response->status);
if (status != GOLIOTH_OK) {
LOG_WRN("Failed to set state: %d", status);
return;
}

Expand Down Expand Up @@ -118,11 +119,9 @@ static int app_state_update_actual(void)
return err;
}

static void app_state_desired_handler(struct golioth_client *client,
const struct golioth_response *response,
const char *path,
const uint8_t *payload,
size_t payload_size,
static void app_state_desired_handler(struct golioth_client *client, enum golioth_status status,
const struct golioth_coap_rsp_code *coap_rsp_code,
const char *path, const uint8_t *payload, size_t payload_size,
void *arg)
{
int err = 0;
Expand All @@ -143,10 +142,8 @@ static void app_state_desired_handler(struct golioth_client *client,

const char *endp_str = endp_list[direction];

if (response->status != GOLIOTH_OK) {
LOG_ERR("Failed to receive '%s' endpoint: %d",
endp_str,
response->status);
if (status != GOLIOTH_OK) {
LOG_ERR("Failed to receive '%s' endpoint: %d", endp_str, status);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LOG_MODULE_REGISTER(thingy91_golioth, LOG_LEVEL_DBG);
#include <modem/modem_info.h>
#endif

// Current firmware version; update in VERSION
/* Current firmware version; update in VERSION */
static const char *_current_version =
STRINGIFY(APP_VERSION_MAJOR) "." STRINGIFY(APP_VERSION_MINOR) "." STRINGIFY(APP_PATCHLEVEL);

Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ manifest:
projects:
- name: golioth
path: modules/lib/golioth-firmware-sdk
revision: v0.15.0
revision: v0.16.0
url: https://github.com/golioth/golioth-firmware-sdk.git
west-commands: scripts/west-commands.yml
submodules: true
Expand Down
Loading