Skip to content

Commit

Permalink
add sim bin - test
Browse files Browse the repository at this point in the history
* Update workflow.yaml

* Update README.md

* Update new_pins.h

* Update workflow.yaml

* Update workflow.yaml

* fx

* fx

* fx

* rellll

* fix

* fix errors

* ddddddd

* qqq

* fx

* tr

* w

* s

* tr

* tr

* tr

* tr

* tr

* tr

* tr

* tr1

* tr

* tr

* test

* tr

* tr3

* fix

* tr1

* Update workflow.yaml

* dlls

* tr

* tr

* needs

* flat

* tr
  • Loading branch information
openshwprojects authored Sep 19, 2024
1 parent afa7b8a commit 23cf6c5
Show file tree
Hide file tree
Showing 8 changed files with 492 additions and 807 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,39 @@ jobs:
echo "::set-output name=short_ref::${BRANCHTRANSLATED}"
echo "::set-output name=sha_short::SHA-$(git rev-parse --short=12 HEAD)"
echo "::set-output name=version::${VERSION}"
build2:
name: Build Simulator
needs: refs
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup MSBuild
uses: microsoft/[email protected]

- name: Checkout simulator repository
run: |
git clone https://github.com/openshwprojects/obkSimulator
mkdir -p ./libs_for_simulator
cp -r ./obkSimulator/simulator/libs_for_simulator/* ./libs_for_simulator
- name: Build project
run: msbuild openBeken_win32_mvsc2017.vcxproj /p:Configuration=Release /p:PlatformToolset=v143
- name: Flatten build assets
run: |
mkdir -p flat
cp ./Release/openBeken_win32.exe flat/
cp ./obkSimulator/simulator/*.dll flat/
- name: Compress build assets
run: |
Compress-Archive -Path flat/* -DestinationPath obkSimulator_win32_${{ needs.refs.outputs.version }}.zip
- name: Upload build assets
uses: actions/upload-artifact@v3
with:
name: obkSimulator_win32_${{ needs.refs.outputs.version }}
path: obkSimulator_win32_${{ needs.refs.outputs.version }}.zip
build:
name: Build
needs: refs
Expand Down
Binary file added Release Win32/openBeken_win32.exp
Binary file not shown.
1,223 changes: 435 additions & 788 deletions openBeken_win32_mvsc2017.vcxproj

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions openBeken_win32_mvsc2017.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@
<ClCompile Include="src\driver\drv_spiLED.c" />
<ClCompile Include="src\driver\drv_sm15155e.c" />
<ClCompile Include="src\selftest\selftest_demo_signAndValue.c" />
<ClCompile Include="src\driver\drv_charts.c" />
<ClCompile Include="src\driver\drv_test_charts.c" />
<ClCompile Include="src\sim\Controller_Switch.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\base64\base64.h" />
Expand Down Expand Up @@ -491,6 +494,7 @@
<ClInclude Include="src\obk_config.h" />
<ClInclude Include="src\sim\Controller_WS2812.h" />
<ClInclude Include="src\driver\drv_spiLED.h" />
<ClInclude Include="src\sim\Controller_Switch.h" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\platforms\bk7231t\bk7231t_os\beken378\func\include\net_param_pub.h" />
Expand Down
2 changes: 1 addition & 1 deletion src/cmnds/cmd_channels.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ void CMD_InitChannelCommands(){
//cmddetail:"fn":"SetChannelEnum","file":"cmnds/cmd_channels.c","requires":"",
//cmddetail:"examples":""}
#if WINDOWS
CMD_RegisterCommand("SetChannelEnum", CMD_SetChannelEnum, NULL);
///CMD_RegisterCommand("SetChannelEnum", CMD_SetChannelEnum, NULL);
#endif
//cmddetail:{"name":"SetChannelLabel","args":"[ChannelIndex][Str][bHideTogglePrefix]",
//cmddetail:"descr":"Sets a channel label for UI and default entity name for Home Assistant discovery. If you use 1 for bHideTogglePrefix, then the 'Toggle ' prefix from UI button will be omitted",
Expand Down
2 changes: 2 additions & 0 deletions src/new_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "new_common.h"
#include "hal/hal_wifi.h"

#define test12321321 321321321

typedef enum ioRole_e {
//iodetail:{"name":"None",
//iodetail:"title":"TODO",
Expand Down
33 changes: 16 additions & 17 deletions src/selftest/selftest_expandConstant.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,63 @@ void Test_ExpandConstant() {
// reset whole device
SIM_ClearOBK(0);

CMD_ExpandConstantsWithinString("Hello", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("Hello", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "Hello");


CHANNEL_Set(1, 123, 0);
CMD_ExpandConstantsWithinString("$CH1", buffer,sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("$CH1", buffer,sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "123");

CHANNEL_Set(1, 456, 0);
CMD_ExpandConstantsWithinString("$CH1", buffer, sizeof(buffer), 0);;
CMD_ExpandConstantsWithinString("$CH1", buffer, sizeof(buffer));;
SELFTEST_ASSERT_STRING(buffer, "456");

CHANNEL_Set(11, 2022, 0);
// must be able to tell whether it's $CH11 or a $CH1
CMD_ExpandConstantsWithinString("$CH11", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("$CH11", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "2022");

CMD_ExpandConstantsWithinString("$CH1", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("$CH1", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "456");

// must be able to tell whether it's $CH11 or a $CH1 - with a suffix
CMD_ExpandConstantsWithinString("$CH11ba", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("$CH11ba", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "2022ba");

CMD_ExpandConstantsWithinString("$CH1ba", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("$CH1ba", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "456ba");

// must be able to tell whether it's $CH11 or a $CH1 - with a prefix
CMD_ExpandConstantsWithinString("ba$CH11", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("ba$CH11", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "ba2022");

CMD_ExpandConstantsWithinString("ba$CH1", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("ba$CH1", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "ba456");

// must be able to tell whether it's $CH11 or a $CH1 - with a prefix and a suffix
CMD_ExpandConstantsWithinString("ba$CH11ha", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("ba$CH11ha", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "ba2022ha");

CMD_ExpandConstantsWithinString("ba$CH1ha", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("ba$CH1ha", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "ba456ha");

CMD_ExpandConstantsWithinString("ba$CH1$CH1ha", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("ba$CH1$CH1ha", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "ba456456ha");

CMD_ExpandConstantsWithinString("$CH1$CH1ha", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("$CH1$CH1ha", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "456456ha");

CMD_ExpandConstantsWithinString("$CH1$CH1", buffer, sizeof(buffer), 0);
CMD_ExpandConstantsWithinString("$CH1$CH1", buffer, sizeof(buffer));
SELFTEST_ASSERT_STRING(buffer, "456456");

// check buffer len truncating
CMD_ExpandConstantsWithinString("Hello long one!", smallBuffer, sizeof(smallBuffer), 0);
CMD_ExpandConstantsWithinString("Hello long one!", smallBuffer, sizeof(smallBuffer));
// Buffer was too short - text truncated!
SELFTEST_ASSERT_STRING(smallBuffer, "Hello l");


//CMD_ExpandConstantsWithinString("Hello $CH1", smallBuffer, sizeof(smallBuffer), 0);
//CMD_ExpandConstantsWithinString("Hello $CH1", smallBuffer, sizeof(smallBuffer));
// Buffer was too short - text truncated!
//SELFTEST_ASSERT_STRING(smallBuffer, "Hello 4");
// NOTE: it won't work like that because of the sprintf behaviour....
Expand Down Expand Up @@ -115,7 +115,6 @@ void Test_ExpandConstant() {
free(ptr);
//system("pause");


CFG_SetFlag(OBK_FLAG_HTTP_PINMONITOR, 0);
ptr = CMD_ExpandingStrdup("$FLAG13");
SELFTEST_ASSERT_STRING(ptr, "0");
Expand Down
2 changes: 1 addition & 1 deletion src/win_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void SIM_ClearOBK(const char *flashPath) {
Main_Init();
}
void Win_DoUnitTests() {
Test_Enums();
//Test_Enums();
Test_Backlog();
Test_DoorSensor();
Test_WS2812B();
Expand Down

0 comments on commit 23cf6c5

Please sign in to comment.