Skip to content

Commit

Permalink
update version to handle hidapi 0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhard Aigner committed Jun 15, 2023
1 parent d364311 commit 3513e73
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "HidApi"
uuid = "39e74766-396e-420b-955c-dcb1d9319e05"
authors = ["Gerhard Aigner <[email protected]>"]
version = "1.2.0"
version = "1.3.0"

[deps]
hidapi_jll = "fc16ec7e-3cba-5ca4-a17a-1acd8165bbee"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This is a high level, cross platform wrapper of the `hidapi` library <https://gi
Julia. It comes with _batteries included_ and can be used to communicate with HID devices on _Linux, Mac and Windows_.

### Changelog
- 1.3.0
- Added `hid_get_report_descriptor(...)` call
- 1.2.0
- Added doc strings for low level api
- Updated to use hidapi library version 0.13.1
Expand Down
3 changes: 3 additions & 0 deletions gen/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[deps]
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
hidapi_jll = "fc16ec7e-3cba-5ca4-a17a-1acd8165bbee"
45 changes: 0 additions & 45 deletions gen/wrapping.jl

This file was deleted.

22 changes: 22 additions & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,28 @@ function hid_get_indexed_string(dev, string_index, string, maxlen)
@ccall hidapi.hid_get_indexed_string(dev::Ptr{hid_device}, string_index::Cint, string::Ptr{Cwchar_t}, maxlen::Csize_t)::Cint
end

"""
hid_get_report_descriptor(dev, buf, buf_size)
Get a report descriptor from a HID device.
Since version 0.14.0, HID_API_VERSION >= HID\\_API\\_MAKE\\_VERSION(0, 14, 0)
User has to provide a preallocated buffer where descriptor will be copied to. The recommended size for preallocated buffer is HID_API_MAX_REPORT_DESCRIPTOR_SIZE bytes.
` API`
### Parameters
* `dev`: A device handle returned from hid\\_open().
* `buf`: The buffer to copy descriptor into.
* `buf_size`: The size of the buffer in bytes.
### Returns
This function returns non-negative number of bytes actually copied, or -1 on error.
"""
function hid_get_report_descriptor(dev, buf, buf_size)
@ccall hidapi.hid_get_report_descriptor(dev::Ptr{hid_device}, buf::Ptr{Cuchar}, buf_size::Csize_t)::Cint
end

"""
hid_error(dev)
Expand Down
5 changes: 5 additions & 0 deletions src/common.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
hid_api_version
A structure to hold the version numbers.
"""
struct hid_api_version
major::Cint
minor::Cint
Expand Down

2 comments on commit 3513e73

@laborg
Copy link
Owner

@laborg laborg commented on 3513e73 Jun 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/85643

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.0 -m "<description of version>" 3513e733e3dc01846fba95eb8d463b1c515339df
git push origin v1.3.0

Please sign in to comment.