Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
05134e7
try offering FCB function
Apollon77 Apr 23, 2018
075ae5c
try offering FCB function
Apollon77 Apr 23, 2018
ea938cd
Merge branch 'master' of https://github.com/Apollon77/libmbus
Apollon77 May 4, 2019
d7f4d88
Merge pull request #1 from rscada/master
Apollon77 Oct 16, 2019
324b242
try offering FCB function
Apollon77 Apr 23, 2018
b89b107
Merge branch 'master' of https://github.com/Apollon77/libmbus
Apollon77 Jun 30, 2020
3722505
Also generate normalized XML
lategoodbye Jul 6, 2020
581a8d1
Add normalized XML files of test frames
lategoodbye Jul 6, 2020
a7fb39f
Fix VIF descriptions
lategoodbye Jul 6, 2020
d0406df
Update normalized XML files
lategoodbye Jul 6, 2020
8fe42f9
Implement all of VIF extensions for 0xFD (#166)
andershub4 Jun 4, 2020
8d04991
Implement all of VIF extensions for 0xFB (#166)
fredrik-sk Jul 7, 2020
36a4fbd
Improve product strings for Aquametro and Sensus
lategoodbye Jul 8, 2020
7b10dc2
Add more test frames
lategoodbye Jul 8, 2020
be23bda
Remove duplicate
lategoodbye Jul 8, 2020
647cede
Move RVD235 out of unsupported
lategoodbye Jul 8, 2020
db42619
Move invalid_length*.hex to test/unsupported-frames (#165)
fredrik-sk Jul 7, 2020
2dc6c6b
Enforce tests execute ok (#165)
fredrik-sk Jul 1, 2020
8ab5d9e
Fix bug, test script should accept both 1 and 2 arguments (#165)
fredrik-sk Jul 1, 2020
48c0310
Rewrite ccpp.yml to use multi-line command (#165)
fredrik-sk Jul 1, 2020
c8940fa
Add Dockerfile.test to run tests from docker (#165)
f-skold Jun 4, 2020
0b4ada1
build: temporary revert to autotools (#174)
lategoodbye Jul 19, 2020
fcfa11d
changelog: Add release 0.9.0
lategoodbye Jul 19, 2020
17b2c1d
try offering FCB function
Apollon77 Apr 23, 2018
e83566c
Merge branch 'master' of https://github.com/Apollon77/libmbus
Apollon77 Jun 29, 2022
a5b2565
* add github action build and tests
Apollon77 Jun 29, 2022
c98829b
* add github action build and tests
Apollon77 Jun 29, 2022
3d59ab3
* add automake on macos
Apollon77 Jun 29, 2022
28f3e60
* add automake on macos
Apollon77 Jun 29, 2022
2316864
* adjust testing
Apollon77 Jun 29, 2022
83689c7
* adjust testing
Apollon77 Jun 29, 2022
b15defb
* adjust testing
Apollon77 Jun 29, 2022
fc8bb5e
* remove travis
Apollon77 Jun 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

# Run this job on all pushes and pull requests
# as well as tags with a semantic version
on:
push:
branches:
- '*'
pull_request: {}

jobs:

# Runs lib tests on all supported node versions and OSes
build-and-test:
if: contains(github.event.head_commit.message, '[skip ci]') == false

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v1

- name: Install automake (macos)
if: startsWith(runner.OS, 'macOS')
run: brew install automake

- name: Build
run: ./build.sh

- name: Build tests
run: cd test && make

- name: Test Success Frames
run: cd test && ./generate-xml.sh test-frames

- name: Test Error Frames
run: cd test && ./generate-xml.sh error-frames || true

- name: Test Unsupported Frames
run: cd test && ./generate-xml.sh unsupported-frames || true
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

36 changes: 36 additions & 0 deletions mbus/mbus-protocol-aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,42 @@ mbus_send_request_frame(mbus_handle * handle, int address)
return retval;
}

//------------------------------------------------------------------------------
// send a request packet to from master to slave
//------------------------------------------------------------------------------
int
mbus_send_request_frame_fcb(mbus_handle * handle, int address)
{
int retval = 0;
mbus_frame *frame;

if (mbus_is_primary_address(address) == 0)
{
MBUS_ERROR("%s: invalid address %d\n", __PRETTY_FUNCTION__, address);
return -1;
}

frame = mbus_frame_new(MBUS_FRAME_TYPE_SHORT);

if (frame == NULL)
{
MBUS_ERROR("%s: failed to allocate mbus frame.\n", __PRETTY_FUNCTION__);
return -1;
}

frame->control = MBUS_CONTROL_MASK_REQ_UD2 | MBUS_CONTROL_MASK_DIR_M2S | MBUS_CONTROL_MASK_FCB;
frame->address = address;

if (mbus_send_frame(handle, frame) == -1)
{
MBUS_ERROR("%s: failed to send mbus frame.\n", __PRETTY_FUNCTION__);
retval = -1;
}

mbus_frame_free(frame);
return retval;
}

//------------------------------------------------------------------------------
// send a user data packet from master to slave
//------------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions mbus/mbus-protocol-aux.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef struct _mbus_handle {
void (*recv_event) (unsigned char src_type, const char *buff, size_t len);
void (*send_event) (unsigned char src_type, const char *buff, size_t len);
void (*scan_progress) (struct _mbus_handle *handle, const char *mask);
void (*found_event) (struct _mbus_handle *handle, mbus_frame *frame);
void (*found_event) (struct _mbus_handle *handle, mbus_frame *frame);
void *auxdata;
} mbus_handle;

Expand Down Expand Up @@ -293,7 +293,8 @@ int mbus_send_switch_baudrate_frame(mbus_handle * handle, int address, long baud
*
* @return Zero when successful.
*/
int mbus_send_request_frame(mbus_handle * handle, int address);
int mbus_send_request_frame(mbus_handle * handle, int address);
int mbus_send_request_frame_fcb(mbus_handle * handle, int address);

/**
* Sends user data frame (SND_UD) to given slave using "unified" handle
Expand Down