Skip to content

Commit

Permalink
Added RVC3 support, modified build CI a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
themarpe committed Jan 16, 2023
1 parent 9350eb2 commit 9d545a2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Build and publish NPM

on:
workflow_dispatch:
push:
branches:
- main
- rvc3_support
tags:
- 'v*'

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
Expand All @@ -13,9 +19,9 @@ jobs:
matrix:
runner: ["buildjet-2vcpu-ubuntu-2204", "buildjet-2vcpu-ubuntu-2204-arm"]
runs-on: ${{ matrix.runner }}
permissions:
permissions:
contents: read
packages: write
packages: write
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -48,13 +54,14 @@ jobs:
with:
name: prebuilds-${{ matrix.runner }}
path: prebuilds/*.node

publish:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: buildjet-2vcpu-ubuntu-2204
needs: ["build"]
permissions:
permissions:
contents: read
packages: write
packages: write
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -73,7 +80,7 @@ jobs:
echo "Prepared prebuilds..."
npm install
npm run relocate-prebuilds
echo "Validating..."
npm install
npm run test
Expand Down
2 changes: 1 addition & 1 deletion depthai-core
Submodule depthai-core updated 124 files
12 changes: 9 additions & 3 deletions src/device-wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Napi::Object DeviceWrapper::Init(Napi::Env env, Napi::Object exports)
return exports;
}

Napi::Value DeviceWrapper::getAllAvailableDevices(const Napi::CallbackInfo& info)
Napi::Value DeviceWrapper::getAllAvailableDevices(const Napi::CallbackInfo& info)
{
return DeviceWrapper::deviceInfosToNode(info.Env(), dai::Device::getAllAvailableDevices());
}

Napi::Value DeviceWrapper::getAllConnectedDevices(const Napi::CallbackInfo& info)
Napi::Value DeviceWrapper::getAllConnectedDevices(const Napi::CallbackInfo& info)
{
return DeviceWrapper::deviceInfosToNode(info.Env(), dai::Device::getAllConnectedDevices());
}
Expand All @@ -36,7 +36,7 @@ Napi::Array DeviceWrapper::deviceInfosToNode(Napi::Env env, std::vector<dai::Dev
nodeArray[i] = deviceInfo;
}
return nodeArray;
}
}

Napi::String DeviceWrapper::nodeEnumFromState(Napi::Env env, XLinkDeviceState_t state)
{
Expand All @@ -49,6 +49,10 @@ Napi::String DeviceWrapper::nodeEnumFromState(Napi::Env env, XLinkDeviceState_t
return Napi::String::New(env, "bootloader");
case X_LINK_FLASH_BOOTED:
return Napi::String::New(env, "flash-booted");
case X_LINK_GATE:
return Napi::String::New(env, "gate");
case X_LINK_GATE_BOOTED:
return Napi::String::New(env, "gate-booted");
case X_LINK_ANY_STATE:
default:
return Napi::String::New(env, "unknown");
Expand Down Expand Up @@ -83,6 +87,8 @@ Napi::String DeviceWrapper::nodeEnumFromPlatform(Napi::Env env, XLinkPlatform_t
return Napi::String::New(env, "myriad-2");
case X_LINK_MYRIAD_X:
return Napi::String::New(env, "myriad-x");
case X_LINK_RVC3:
return Napi::String::New(env, "rvc3");
case X_LINK_ANY_PLATFORM:
default:
return Napi::String::New(env, "unknown");
Expand Down

0 comments on commit 9d545a2

Please sign in to comment.