Skip to content

Commit

Permalink
Merge pull request #3 from boschrexroth/feature/update120
Browse files Browse the repository at this point in the history
Feature/update120
  • Loading branch information
Johannes Albrecht committed Apr 11, 2023
2 parents 24d36af + 0ddf8f5 commit c21d1a2
Show file tree
Hide file tree
Showing 745 changed files with 88,714 additions and 77,912 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -24,8 +24,8 @@ jobs:
sudo apt-get update
sudo apt-get install -y libsystemd-dev libzmq3-dev
sudo apt install pkg-config
wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/1.18.0/ctrlx-datalayer-1.9.1.deb
sudo apt-get install -y -f ./ctrlx-datalayer-1.9.1.deb
wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/1.20.0/ctrlx-datalayer-1.10.7.deb
sudo apt-get install -y -f ./ctrlx-datalayer-1.10.7.deb
- name: Go
uses: actions/setup-go@v2
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -8,8 +8,8 @@ GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
BUILD := build/public/$(GOOS)_$(GOARCH)

DATALAYER_DEB_VERSION := 1.18.0
DATALAYER_DEB_FILE_VERSION := 1.9.1
DATALAYER_DEB_VERSION := 1.20.0
DATALAYER_DEB_FILE_VERSION := 1.10.7

.PHONY: all go-dep apt-dep lint vet test test-coverage build clean

Expand Down Expand Up @@ -43,7 +43,7 @@ cpuprofile: ## Run cpu profiler
@go test -race -short -count=1 -mod=vendor $(TST_LIST) -cpuprofile cpu.pprof
@go tool pprof -http=:8080 cpu.pprof

testcover: ## Run unittests with coverage
testcover: ## Run unittests with coverage 'go tool cover -html=coverage.out -o coverage.html'
@go test -race -short -count=1 -mod=vendor -coverpkg=$(COV_PKG_LIST) -coverprofile=coverage.out -covermode=atomic $(TST_LIST)

build: go-dep ## Build the samples
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -44,8 +44,8 @@ sudo apt-get install libsystemd-dev libsystemd-dev:arm64 libzmq3-dev libzmq3-dev
Check the current [ctrlx Data Layer](https://github.com/boschrexroth/ctrlx-automation-sdk/releases) debian package, download and install this, see example.

```bash
wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/1.18.0/ctrlx-datalayer-1.9.1.deb
sudo dpkg -i ctrlx-datalayer-1.9.1.deb
wget https://github.com/boschrexroth/ctrlx-automation-sdk/releases/download/1.20.0/ctrlx-datalayer-1.10.7.deb
sudo dpkg -i ctrlx-datalayer-1.10.7.deb
```

### Integrate in you project
Expand Down
22 changes: 22 additions & 0 deletions pkg/datalayer/client.go
Expand Up @@ -47,8 +47,12 @@ type TimeoutSetting C.enum_DLR_TIMEOUT_SETTING

// TimeoutSetting enum definition
const (
// timeout to check whether to broker is still active when client is idle
TimeoutSettingIdle = C.DLR_TIMEOUT_SETTING_IDLE
// timeout to wait for a response for a request - it timeout exceeds request will be aborted with DL_TIMEOUT
TimeoutSettingPing = C.DLR_TIMEOUT_SETTING_PING
// timeout a reconnect attempt will be done if client looses connection to broker
TimeoutSettingReconnect = C.DLR_TIMEOUT_SETTING_RECONNECT
)

// ResponseCallback function type
Expand Down Expand Up @@ -91,6 +95,9 @@ func (c *Client) PingAsync(onResponse ResponseCallback) Result {
// Parameter userdata will be returned in callback as a user data. You can use this userdata to identify your request.
// It returns the status of function call.
func (c *Client) CreateAsync(address string, data *Variant, onResponse ResponseCallback) Result {
if data == nil {
return ResultMissingArgument
}
caddress := C.CString(address)
defer C.free(unsafe.Pointer(caddress))
return Result(C.ClientCreateASync(c.this, caddress, data.this, nil, responseRegister(onResponse)))
Expand Down Expand Up @@ -124,6 +131,9 @@ func (c *Client) BrowseAsync(address string, onResponse ResponseCallback) Result
// Parameter userdata will be returned in callback as a user data. You can use this userdata to identify your request.
// It returns the status of function call.
func (c *Client) ReadAsync(address string, data *Variant, onResponse ResponseCallback) Result {
if data == nil {
return ResultMissingArgument
}
caddress := C.CString(address)
defer C.free(unsafe.Pointer(caddress))
return Result(C.ClientReadASync(c.this, caddress, data.this, nil, responseRegister(onResponse)))
Expand All @@ -136,6 +146,9 @@ func (c *Client) ReadAsync(address string, data *Variant, onResponse ResponseCal
// Parameter userdata will be returned in callback as a user data. You can use this userdata to identify your request.
// It returns the status of function call.
func (c *Client) WriteAsync(address string, data *Variant, onResponse ResponseCallback) Result {
if data == nil {
return ResultMissingArgument
}
caddress := C.CString(address)
defer C.free(unsafe.Pointer(caddress))
return Result(C.ClientWriteASync(c.this, caddress, data.this, nil, responseRegister(onResponse)))
Expand Down Expand Up @@ -180,6 +193,9 @@ type OnSubscription func(result Result, items map[string]Variant)

// DeleteSubscription deletes a subscription.
func (c *Client) DeleteSubscription(subscription *Subscription) {
if subscription == nil {
return
}
cId := C.CString(subscription.id)
defer C.free(unsafe.Pointer(cId))
notifyResponseUnregister(subscription.notifyKey)
Expand Down Expand Up @@ -208,6 +224,9 @@ func (c *Client) PingSync() Result {
// Parameter variant is a data of the object.
// It returns the status of function call or a variant result of write or a tuple (Result, Variant).
func (c *Client) CreateSync(address string, data *Variant) Result {
if data == nil {
return ResultMissingArgument
}
caddress := C.CString(address)
defer C.free(unsafe.Pointer(caddress))
return Result(C.DLR_clientCreateSync(c.this, caddress, data.this, nil))
Expand Down Expand Up @@ -270,6 +289,9 @@ func (c *Client) ReadSync(address string) (Result, *Variant) {
// Parameter variant ia a new data of the node.
// It returns the status of function call or a result of write or a tuple Result, Variant).
func (c *Client) WriteSync(address string, data *Variant) Result {
if data == nil {
return ResultMissingArgument
}
caddress := C.CString(address)
defer C.free(unsafe.Pointer(caddress))
return Result(C.DLR_clientWriteSync(c.this, caddress, data.this, nil))
Expand Down
2 changes: 1 addition & 1 deletion pkg/datalayer/responseHandler.c
Expand Up @@ -66,7 +66,7 @@ DLR_RESULT ClientReadASync(DLR_CLIENT client, const char *address, DLR_VARIANT v
// Wrapper for DLR_clientWriteASync with responseKey instead of userdata
DLR_RESULT ClientWriteASync(DLR_CLIENT client, const char *address, DLR_VARIANT variant, const char *token, unsigned long long responseKey)
{
return DLR_clientReadASync(client, address, variant, token, responseCallback, (void *)responseKey);
return DLR_clientWriteASync(client, address, variant, token, responseCallback, (void *)responseKey);
}

// Wrapper for DLR_clientMetadataASync with responseKey instead of userdata
Expand Down
236 changes: 118 additions & 118 deletions pkg/fbs/comm/axisprofile/fbtypes/APRBootState.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c21d1a2

Please sign in to comment.