first commit
This commit is contained in:
@ -0,0 +1,168 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation/collections"
|
||||
)
|
||||
|
||||
const SignatureBluetoothLEAdvertisement string = "rc(Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisement;{066fb2b7-33d1-4e7d-8367-cf81d0f79653})"
|
||||
|
||||
type BluetoothLEAdvertisement struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func NewBluetoothLEAdvertisement() (*BluetoothLEAdvertisement, error) {
|
||||
inspectable, err := ole.RoActivateInstance("Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisement")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return (*BluetoothLEAdvertisement)(unsafe.Pointer(inspectable)), nil
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisement) GetLocalName() (string, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisement))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisement)(unsafe.Pointer(itf))
|
||||
return v.GetLocalName()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisement) SetLocalName(value string) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisement))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisement)(unsafe.Pointer(itf))
|
||||
return v.SetLocalName(value)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisement) GetServiceUuids() (*collections.IVector, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisement))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisement)(unsafe.Pointer(itf))
|
||||
return v.GetServiceUuids()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisement) GetManufacturerData() (*collections.IVector, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisement))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisement)(unsafe.Pointer(itf))
|
||||
return v.GetManufacturerData()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisement) GetDataSections() (*collections.IVector, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisement))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisement)(unsafe.Pointer(itf))
|
||||
return v.GetDataSections()
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEAdvertisement string = "066fb2b7-33d1-4e7d-8367-cf81d0f79653"
|
||||
const SignatureiBluetoothLEAdvertisement string = "{066fb2b7-33d1-4e7d-8367-cf81d0f79653}"
|
||||
|
||||
type iBluetoothLEAdvertisement struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEAdvertisementVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetFlags uintptr
|
||||
SetFlags uintptr
|
||||
GetLocalName uintptr
|
||||
SetLocalName uintptr
|
||||
GetServiceUuids uintptr
|
||||
GetManufacturerData uintptr
|
||||
GetDataSections uintptr
|
||||
GetManufacturerDataByCompanyId uintptr
|
||||
GetSectionsByType uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisement) VTable() *iBluetoothLEAdvertisementVtbl {
|
||||
return (*iBluetoothLEAdvertisementVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisement) GetLocalName() (string, error) {
|
||||
var outHStr ole.HString
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetLocalName,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&outHStr)), // out string
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return "", ole.NewError(hr)
|
||||
}
|
||||
|
||||
out := outHStr.String()
|
||||
ole.DeleteHString(outHStr)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisement) SetLocalName(value string) error {
|
||||
valueHStr, err := ole.NewHString(value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetLocalName,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(valueHStr), // in string
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisement) GetServiceUuids() (*collections.IVector, error) {
|
||||
var out *collections.IVector
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetServiceUuids,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVector
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisement) GetManufacturerData() (*collections.IVector, error) {
|
||||
var out *collections.IVector
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetManufacturerData,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVector
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisement) GetDataSections() (*collections.IVector, error) {
|
||||
var out *collections.IVector
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetDataSections,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVector
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
)
|
||||
|
||||
const SignatureBluetoothLEAdvertisementDataSection string = "rc(Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementDataSection;{d7213314-3a43-40f9-b6f0-92bfefc34ae3})"
|
||||
|
||||
type BluetoothLEAdvertisementDataSection struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func NewBluetoothLEAdvertisementDataSection() (*BluetoothLEAdvertisementDataSection, error) {
|
||||
inspectable, err := ole.RoActivateInstance("Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementDataSection")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return (*BluetoothLEAdvertisementDataSection)(unsafe.Pointer(inspectable)), nil
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementDataSection) GetDataType() (uint8, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementDataSection))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementDataSection)(unsafe.Pointer(itf))
|
||||
return v.GetDataType()
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEAdvertisementDataSection string = "d7213314-3a43-40f9-b6f0-92bfefc34ae3"
|
||||
const SignatureiBluetoothLEAdvertisementDataSection string = "{d7213314-3a43-40f9-b6f0-92bfefc34ae3}"
|
||||
|
||||
type iBluetoothLEAdvertisementDataSection struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEAdvertisementDataSectionVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDataType uintptr
|
||||
SetDataType uintptr
|
||||
GetData uintptr
|
||||
SetData uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementDataSection) VTable() *iBluetoothLEAdvertisementDataSectionVtbl {
|
||||
return (*iBluetoothLEAdvertisementDataSectionVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementDataSection) GetDataType() (uint8, error) {
|
||||
var out uint8
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetDataType,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint8
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
)
|
||||
|
||||
const SignatureBluetoothLEAdvertisementPublisher string = "rc(Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementPublisher;{cde820f9-d9fa-43d6-a264-ddd8b7da8b78})"
|
||||
|
||||
type BluetoothLEAdvertisementPublisher struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func NewBluetoothLEAdvertisementPublisher() (*BluetoothLEAdvertisementPublisher, error) {
|
||||
inspectable, err := ole.RoActivateInstance("Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementPublisher")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return (*BluetoothLEAdvertisementPublisher)(unsafe.Pointer(inspectable)), nil
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementPublisher) GetStatus() (BluetoothLEAdvertisementPublisherStatus, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementPublisher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementPublisher)(unsafe.Pointer(itf))
|
||||
return v.GetStatus()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementPublisher) GetAdvertisement() (*BluetoothLEAdvertisement, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementPublisher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementPublisher)(unsafe.Pointer(itf))
|
||||
return v.GetAdvertisement()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementPublisher) Start() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementPublisher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementPublisher)(unsafe.Pointer(itf))
|
||||
return v.Start()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementPublisher) Stop() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementPublisher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementPublisher)(unsafe.Pointer(itf))
|
||||
return v.Stop()
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEAdvertisementPublisher string = "cde820f9-d9fa-43d6-a264-ddd8b7da8b78"
|
||||
const SignatureiBluetoothLEAdvertisementPublisher string = "{cde820f9-d9fa-43d6-a264-ddd8b7da8b78}"
|
||||
|
||||
type iBluetoothLEAdvertisementPublisher struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEAdvertisementPublisherVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetStatus uintptr
|
||||
GetAdvertisement uintptr
|
||||
Start uintptr
|
||||
Stop uintptr
|
||||
AddStatusChanged uintptr
|
||||
RemoveStatusChanged uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementPublisher) VTable() *iBluetoothLEAdvertisementPublisherVtbl {
|
||||
return (*iBluetoothLEAdvertisementPublisherVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementPublisher) GetStatus() (BluetoothLEAdvertisementPublisherStatus, error) {
|
||||
var out BluetoothLEAdvertisementPublisherStatus
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetStatus,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out BluetoothLEAdvertisementPublisherStatus
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return BluetoothLEAdvertisementPublisherStatusCreated, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementPublisher) GetAdvertisement() (*BluetoothLEAdvertisement, error) {
|
||||
var out *BluetoothLEAdvertisement
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetAdvertisement,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out BluetoothLEAdvertisement
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementPublisher) Start() error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().Start,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementPublisher) Stop() error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().Stop,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEAdvertisementPublisher2 string = "fbdb545e-56f1-510f-a434-217fbd9e7bd2"
|
||||
const SignatureiBluetoothLEAdvertisementPublisher2 string = "{fbdb545e-56f1-510f-a434-217fbd9e7bd2}"
|
||||
|
||||
type iBluetoothLEAdvertisementPublisher2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEAdvertisementPublisher2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetPreferredTransmitPowerLevelInDBm uintptr
|
||||
SetPreferredTransmitPowerLevelInDBm uintptr
|
||||
GetUseExtendedAdvertisement uintptr
|
||||
SetUseExtendedAdvertisement uintptr
|
||||
GetIsAnonymous uintptr
|
||||
SetIsAnonymous uintptr
|
||||
GetIncludeTransmitPowerLevel uintptr
|
||||
SetIncludeTransmitPowerLevel uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementPublisher2) VTable() *iBluetoothLEAdvertisementPublisher2Vtbl {
|
||||
return (*iBluetoothLEAdvertisementPublisher2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
type BluetoothLEAdvertisementPublisherStatus int32
|
||||
|
||||
const SignatureBluetoothLEAdvertisementPublisherStatus string = "enum(Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementPublisherStatus;i4)"
|
||||
|
||||
const (
|
||||
BluetoothLEAdvertisementPublisherStatusCreated BluetoothLEAdvertisementPublisherStatus = 0
|
||||
BluetoothLEAdvertisementPublisherStatusWaiting BluetoothLEAdvertisementPublisherStatus = 1
|
||||
BluetoothLEAdvertisementPublisherStatusStarted BluetoothLEAdvertisementPublisherStatus = 2
|
||||
BluetoothLEAdvertisementPublisherStatusStopping BluetoothLEAdvertisementPublisherStatus = 3
|
||||
BluetoothLEAdvertisementPublisherStatusStopped BluetoothLEAdvertisementPublisherStatus = 4
|
||||
BluetoothLEAdvertisementPublisherStatusAborted BluetoothLEAdvertisementPublisherStatus = 5
|
||||
)
|
@ -0,0 +1,129 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
)
|
||||
|
||||
const SignatureBluetoothLEAdvertisementReceivedEventArgs string = "rc(Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementReceivedEventArgs;{27987ddf-e596-41be-8d43-9e6731d4a913})"
|
||||
|
||||
type BluetoothLEAdvertisementReceivedEventArgs struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementReceivedEventArgs) GetRawSignalStrengthInDBm() (int16, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementReceivedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementReceivedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetRawSignalStrengthInDBm()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementReceivedEventArgs) GetBluetoothAddress() (uint64, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementReceivedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementReceivedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetBluetoothAddress()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementReceivedEventArgs) GetAdvertisement() (*BluetoothLEAdvertisement, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementReceivedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementReceivedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetAdvertisement()
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEAdvertisementReceivedEventArgs string = "27987ddf-e596-41be-8d43-9e6731d4a913"
|
||||
const SignatureiBluetoothLEAdvertisementReceivedEventArgs string = "{27987ddf-e596-41be-8d43-9e6731d4a913}"
|
||||
|
||||
type iBluetoothLEAdvertisementReceivedEventArgs struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEAdvertisementReceivedEventArgsVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetRawSignalStrengthInDBm uintptr
|
||||
GetBluetoothAddress uintptr
|
||||
GetAdvertisementType uintptr
|
||||
GetTimestamp uintptr
|
||||
GetAdvertisement uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementReceivedEventArgs) VTable() *iBluetoothLEAdvertisementReceivedEventArgsVtbl {
|
||||
return (*iBluetoothLEAdvertisementReceivedEventArgsVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementReceivedEventArgs) GetRawSignalStrengthInDBm() (int16, error) {
|
||||
var out int16
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetRawSignalStrengthInDBm,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out int16
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementReceivedEventArgs) GetBluetoothAddress() (uint64, error) {
|
||||
var out uint64
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetBluetoothAddress,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint64
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementReceivedEventArgs) GetAdvertisement() (*BluetoothLEAdvertisement, error) {
|
||||
var out *BluetoothLEAdvertisement
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetAdvertisement,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out BluetoothLEAdvertisement
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEAdvertisementReceivedEventArgs2 string = "12d9c87b-0399-5f0e-a348-53b02b6b162e"
|
||||
const SignatureiBluetoothLEAdvertisementReceivedEventArgs2 string = "{12d9c87b-0399-5f0e-a348-53b02b6b162e}"
|
||||
|
||||
type iBluetoothLEAdvertisementReceivedEventArgs2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEAdvertisementReceivedEventArgs2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetBluetoothAddressType uintptr
|
||||
GetTransmitPowerLevelInDBm uintptr
|
||||
GetIsAnonymous uintptr
|
||||
GetIsConnectable uintptr
|
||||
GetIsScannable uintptr
|
||||
GetIsDirected uintptr
|
||||
GetIsScanResponse uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementReceivedEventArgs2) VTable() *iBluetoothLEAdvertisementReceivedEventArgs2Vtbl {
|
||||
return (*iBluetoothLEAdvertisementReceivedEventArgs2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
@ -0,0 +1,315 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureBluetoothLEAdvertisementWatcher string = "rc(Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher;{a6ac336f-f3d3-4297-8d6c-c81ea6623f40})"
|
||||
|
||||
type BluetoothLEAdvertisementWatcher struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func NewBluetoothLEAdvertisementWatcher() (*BluetoothLEAdvertisementWatcher, error) {
|
||||
inspectable, err := ole.RoActivateInstance("Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return (*BluetoothLEAdvertisementWatcher)(unsafe.Pointer(inspectable)), nil
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) GetStatus() (BluetoothLEAdvertisementWatcherStatus, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher)(unsafe.Pointer(itf))
|
||||
return v.GetStatus()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) GetScanningMode() (BluetoothLEScanningMode, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher)(unsafe.Pointer(itf))
|
||||
return v.GetScanningMode()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) SetScanningMode(value BluetoothLEScanningMode) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher)(unsafe.Pointer(itf))
|
||||
return v.SetScanningMode(value)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) Start() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher)(unsafe.Pointer(itf))
|
||||
return v.Start()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) Stop() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher)(unsafe.Pointer(itf))
|
||||
return v.Stop()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) AddReceived(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher)(unsafe.Pointer(itf))
|
||||
return v.AddReceived(handler)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) RemoveReceived(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher)(unsafe.Pointer(itf))
|
||||
return v.RemoveReceived(token)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) AddStopped(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher)(unsafe.Pointer(itf))
|
||||
return v.AddStopped(handler)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) RemoveStopped(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher)(unsafe.Pointer(itf))
|
||||
return v.RemoveStopped(token)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) GetAllowExtendedAdvertisements() (bool, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher2))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher2)(unsafe.Pointer(itf))
|
||||
return v.GetAllowExtendedAdvertisements()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcher) SetAllowExtendedAdvertisements(value bool) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcher2))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcher2)(unsafe.Pointer(itf))
|
||||
return v.SetAllowExtendedAdvertisements(value)
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEAdvertisementWatcher string = "a6ac336f-f3d3-4297-8d6c-c81ea6623f40"
|
||||
const SignatureiBluetoothLEAdvertisementWatcher string = "{a6ac336f-f3d3-4297-8d6c-c81ea6623f40}"
|
||||
|
||||
type iBluetoothLEAdvertisementWatcher struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEAdvertisementWatcherVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetMinSamplingInterval uintptr
|
||||
GetMaxSamplingInterval uintptr
|
||||
GetMinOutOfRangeTimeout uintptr
|
||||
GetMaxOutOfRangeTimeout uintptr
|
||||
GetStatus uintptr
|
||||
GetScanningMode uintptr
|
||||
SetScanningMode uintptr
|
||||
GetSignalStrengthFilter uintptr
|
||||
SetSignalStrengthFilter uintptr
|
||||
GetAdvertisementFilter uintptr
|
||||
SetAdvertisementFilter uintptr
|
||||
Start uintptr
|
||||
Stop uintptr
|
||||
AddReceived uintptr
|
||||
RemoveReceived uintptr
|
||||
AddStopped uintptr
|
||||
RemoveStopped uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) VTable() *iBluetoothLEAdvertisementWatcherVtbl {
|
||||
return (*iBluetoothLEAdvertisementWatcherVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) GetStatus() (BluetoothLEAdvertisementWatcherStatus, error) {
|
||||
var out BluetoothLEAdvertisementWatcherStatus
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetStatus,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out BluetoothLEAdvertisementWatcherStatus
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return BluetoothLEAdvertisementWatcherStatusCreated, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) GetScanningMode() (BluetoothLEScanningMode, error) {
|
||||
var out BluetoothLEScanningMode
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetScanningMode,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out BluetoothLEScanningMode
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return BluetoothLEScanningModePassive, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) SetScanningMode(value BluetoothLEScanningMode) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetScanningMode,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in BluetoothLEScanningMode
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) Start() error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().Start,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) Stop() error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().Stop,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) AddReceived(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddReceived,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) RemoveReceived(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveReceived,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) AddStopped(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddStopped,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher) RemoveStopped(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveStopped,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEAdvertisementWatcher2 string = "01bf26bc-b164-5805-90a3-e8a7997ff225"
|
||||
const SignatureiBluetoothLEAdvertisementWatcher2 string = "{01bf26bc-b164-5805-90a3-e8a7997ff225}"
|
||||
|
||||
type iBluetoothLEAdvertisementWatcher2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEAdvertisementWatcher2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetAllowExtendedAdvertisements uintptr
|
||||
SetAllowExtendedAdvertisements uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher2) VTable() *iBluetoothLEAdvertisementWatcher2Vtbl {
|
||||
return (*iBluetoothLEAdvertisementWatcher2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher2) GetAllowExtendedAdvertisements() (bool, error) {
|
||||
var out bool
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetAllowExtendedAdvertisements,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return false, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcher2) SetAllowExtendedAdvertisements(value bool) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetAllowExtendedAdvertisements,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(*(*byte)(unsafe.Pointer(&value))), // in bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
type BluetoothLEAdvertisementWatcherStatus int32
|
||||
|
||||
const SignatureBluetoothLEAdvertisementWatcherStatus string = "enum(Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcherStatus;i4)"
|
||||
|
||||
const (
|
||||
BluetoothLEAdvertisementWatcherStatusCreated BluetoothLEAdvertisementWatcherStatus = 0
|
||||
BluetoothLEAdvertisementWatcherStatusStarted BluetoothLEAdvertisementWatcherStatus = 1
|
||||
BluetoothLEAdvertisementWatcherStatusStopping BluetoothLEAdvertisementWatcherStatus = 2
|
||||
BluetoothLEAdvertisementWatcherStatusStopped BluetoothLEAdvertisementWatcherStatus = 3
|
||||
BluetoothLEAdvertisementWatcherStatusAborted BluetoothLEAdvertisementWatcherStatus = 4
|
||||
)
|
@ -0,0 +1,59 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/devices/bluetooth"
|
||||
)
|
||||
|
||||
const SignatureBluetoothLEAdvertisementWatcherStoppedEventArgs string = "rc(Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcherStoppedEventArgs;{dd40f84d-e7b9-43e3-9c04-0685d085fd8c})"
|
||||
|
||||
type BluetoothLEAdvertisementWatcherStoppedEventArgs struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEAdvertisementWatcherStoppedEventArgs) GetError() (bluetooth.BluetoothError, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEAdvertisementWatcherStoppedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEAdvertisementWatcherStoppedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetError()
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEAdvertisementWatcherStoppedEventArgs string = "dd40f84d-e7b9-43e3-9c04-0685d085fd8c"
|
||||
const SignatureiBluetoothLEAdvertisementWatcherStoppedEventArgs string = "{dd40f84d-e7b9-43e3-9c04-0685d085fd8c}"
|
||||
|
||||
type iBluetoothLEAdvertisementWatcherStoppedEventArgs struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEAdvertisementWatcherStoppedEventArgsVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetError uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcherStoppedEventArgs) VTable() *iBluetoothLEAdvertisementWatcherStoppedEventArgsVtbl {
|
||||
return (*iBluetoothLEAdvertisementWatcherStoppedEventArgsVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEAdvertisementWatcherStoppedEventArgs) GetError() (bluetooth.BluetoothError, error) {
|
||||
var out bluetooth.BluetoothError
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetError,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bluetooth.BluetoothError
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return bluetooth.BluetoothErrorSuccess, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureBluetoothLEManufacturerData string = "rc(Windows.Devices.Bluetooth.Advertisement.BluetoothLEManufacturerData;{912dba18-6963-4533-b061-4694dafb34e5})"
|
||||
|
||||
type BluetoothLEManufacturerData struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func NewBluetoothLEManufacturerData() (*BluetoothLEManufacturerData, error) {
|
||||
inspectable, err := ole.RoActivateInstance("Windows.Devices.Bluetooth.Advertisement.BluetoothLEManufacturerData")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return (*BluetoothLEManufacturerData)(unsafe.Pointer(inspectable)), nil
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEManufacturerData) GetCompanyId() (uint16, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEManufacturerData))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEManufacturerData)(unsafe.Pointer(itf))
|
||||
return v.GetCompanyId()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEManufacturerData) SetCompanyId(value uint16) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEManufacturerData))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEManufacturerData)(unsafe.Pointer(itf))
|
||||
return v.SetCompanyId(value)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEManufacturerData) GetData() (*streams.IBuffer, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEManufacturerData))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEManufacturerData)(unsafe.Pointer(itf))
|
||||
return v.GetData()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEManufacturerData) SetData(value *streams.IBuffer) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEManufacturerData))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEManufacturerData)(unsafe.Pointer(itf))
|
||||
return v.SetData(value)
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEManufacturerData string = "912dba18-6963-4533-b061-4694dafb34e5"
|
||||
const SignatureiBluetoothLEManufacturerData string = "{912dba18-6963-4533-b061-4694dafb34e5}"
|
||||
|
||||
type iBluetoothLEManufacturerData struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEManufacturerDataVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetCompanyId uintptr
|
||||
SetCompanyId uintptr
|
||||
GetData uintptr
|
||||
SetData uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEManufacturerData) VTable() *iBluetoothLEManufacturerDataVtbl {
|
||||
return (*iBluetoothLEManufacturerDataVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEManufacturerData) GetCompanyId() (uint16, error) {
|
||||
var out uint16
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCompanyId,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint16
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEManufacturerData) SetCompanyId(value uint16) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetCompanyId,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in uint16
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEManufacturerData) GetData() (*streams.IBuffer, error) {
|
||||
var out *streams.IBuffer
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetData,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEManufacturerData) SetData(value *streams.IBuffer) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetData,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEManufacturerDataFactory string = "c09b39f8-319a-441e-8de5-66a81e877a6c"
|
||||
const SignatureiBluetoothLEManufacturerDataFactory string = "{c09b39f8-319a-441e-8de5-66a81e877a6c}"
|
||||
|
||||
type iBluetoothLEManufacturerDataFactory struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEManufacturerDataFactoryVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
BluetoothLEManufacturerDataCreate uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEManufacturerDataFactory) VTable() *iBluetoothLEManufacturerDataFactoryVtbl {
|
||||
return (*iBluetoothLEManufacturerDataFactoryVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func BluetoothLEManufacturerDataCreate(companyId uint16, data *streams.IBuffer) (*BluetoothLEManufacturerData, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Bluetooth.Advertisement.BluetoothLEManufacturerData", ole.NewGUID(GUIDiBluetoothLEManufacturerDataFactory))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v := (*iBluetoothLEManufacturerDataFactory)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out *BluetoothLEManufacturerData
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().BluetoothLEManufacturerDataCreate,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(companyId), // in uint16
|
||||
uintptr(unsafe.Pointer(data)), // in streams.IBuffer
|
||||
uintptr(unsafe.Pointer(&out)), // out BluetoothLEManufacturerData
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package advertisement
|
||||
|
||||
type BluetoothLEScanningMode int32
|
||||
|
||||
const SignatureBluetoothLEScanningMode string = "enum(Windows.Devices.Bluetooth.Advertisement.BluetoothLEScanningMode;i4)"
|
||||
|
||||
const (
|
||||
BluetoothLEScanningModePassive BluetoothLEScanningMode = 0
|
||||
BluetoothLEScanningModeActive BluetoothLEScanningMode = 1
|
||||
BluetoothLEScanningModeNone BluetoothLEScanningMode = 2
|
||||
)
|
16
windows/devices/bluetooth/bluetoothaddresstype.go
Normal file
16
windows/devices/bluetooth/bluetoothaddresstype.go
Normal file
@ -0,0 +1,16 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package bluetooth
|
||||
|
||||
type BluetoothAddressType int32
|
||||
|
||||
const SignatureBluetoothAddressType string = "enum(Windows.Devices.Bluetooth.BluetoothAddressType;i4)"
|
||||
|
||||
const (
|
||||
BluetoothAddressTypePublic BluetoothAddressType = 0
|
||||
BluetoothAddressTypeRandom BluetoothAddressType = 1
|
||||
BluetoothAddressTypeUnspecified BluetoothAddressType = 2
|
||||
)
|
15
windows/devices/bluetooth/bluetoothcachemode.go
Normal file
15
windows/devices/bluetooth/bluetoothcachemode.go
Normal file
@ -0,0 +1,15 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package bluetooth
|
||||
|
||||
type BluetoothCacheMode int32
|
||||
|
||||
const SignatureBluetoothCacheMode string = "enum(Windows.Devices.Bluetooth.BluetoothCacheMode;i4)"
|
||||
|
||||
const (
|
||||
BluetoothCacheModeCached BluetoothCacheMode = 0
|
||||
BluetoothCacheModeUncached BluetoothCacheMode = 1
|
||||
)
|
15
windows/devices/bluetooth/bluetoothconnectionstatus.go
Normal file
15
windows/devices/bluetooth/bluetoothconnectionstatus.go
Normal file
@ -0,0 +1,15 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package bluetooth
|
||||
|
||||
type BluetoothConnectionStatus int32
|
||||
|
||||
const SignatureBluetoothConnectionStatus string = "enum(Windows.Devices.Bluetooth.BluetoothConnectionStatus;i4)"
|
||||
|
||||
const (
|
||||
BluetoothConnectionStatusDisconnected BluetoothConnectionStatus = 0
|
||||
BluetoothConnectionStatusConnected BluetoothConnectionStatus = 1
|
||||
)
|
106
windows/devices/bluetooth/bluetoothdeviceid.go
Normal file
106
windows/devices/bluetooth/bluetoothdeviceid.go
Normal file
@ -0,0 +1,106 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package bluetooth
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
)
|
||||
|
||||
const SignatureBluetoothDeviceId string = "rc(Windows.Devices.Bluetooth.BluetoothDeviceId;{c17949af-57c1-4642-bcce-e6c06b20ae76})"
|
||||
|
||||
type BluetoothDeviceId struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *BluetoothDeviceId) GetId() (string, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothDeviceId))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothDeviceId)(unsafe.Pointer(itf))
|
||||
return v.GetId()
|
||||
}
|
||||
|
||||
func (impl *BluetoothDeviceId) GetIsClassicDevice() (bool, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothDeviceId))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothDeviceId)(unsafe.Pointer(itf))
|
||||
return v.GetIsClassicDevice()
|
||||
}
|
||||
|
||||
func (impl *BluetoothDeviceId) GetIsLowEnergyDevice() (bool, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothDeviceId))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothDeviceId)(unsafe.Pointer(itf))
|
||||
return v.GetIsLowEnergyDevice()
|
||||
}
|
||||
|
||||
const GUIDiBluetoothDeviceId string = "c17949af-57c1-4642-bcce-e6c06b20ae76"
|
||||
const SignatureiBluetoothDeviceId string = "{c17949af-57c1-4642-bcce-e6c06b20ae76}"
|
||||
|
||||
type iBluetoothDeviceId struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothDeviceIdVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetId uintptr
|
||||
GetIsClassicDevice uintptr
|
||||
GetIsLowEnergyDevice uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothDeviceId) VTable() *iBluetoothDeviceIdVtbl {
|
||||
return (*iBluetoothDeviceIdVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothDeviceId) GetId() (string, error) {
|
||||
var outHStr ole.HString
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetId,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&outHStr)), // out string
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return "", ole.NewError(hr)
|
||||
}
|
||||
|
||||
out := outHStr.String()
|
||||
ole.DeleteHString(outHStr)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothDeviceId) GetIsClassicDevice() (bool, error) {
|
||||
var out bool
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetIsClassicDevice,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return false, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothDeviceId) GetIsLowEnergyDevice() (bool, error) {
|
||||
var out bool
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetIsLowEnergyDevice,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return false, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
23
windows/devices/bluetooth/bluetootherror.go
Normal file
23
windows/devices/bluetooth/bluetootherror.go
Normal file
@ -0,0 +1,23 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package bluetooth
|
||||
|
||||
type BluetoothError int32
|
||||
|
||||
const SignatureBluetoothError string = "enum(Windows.Devices.Bluetooth.BluetoothError;i4)"
|
||||
|
||||
const (
|
||||
BluetoothErrorSuccess BluetoothError = 0
|
||||
BluetoothErrorRadioNotAvailable BluetoothError = 1
|
||||
BluetoothErrorResourceInUse BluetoothError = 2
|
||||
BluetoothErrorDeviceNotConnected BluetoothError = 3
|
||||
BluetoothErrorOtherError BluetoothError = 4
|
||||
BluetoothErrorDisabledByPolicy BluetoothError = 5
|
||||
BluetoothErrorNotSupported BluetoothError = 6
|
||||
BluetoothErrorDisabledByUser BluetoothError = 7
|
||||
BluetoothErrorConsentRequired BluetoothError = 8
|
||||
BluetoothErrorTransportNotSupported BluetoothError = 9
|
||||
)
|
373
windows/devices/bluetooth/bluetoothledevice.go
Normal file
373
windows/devices/bluetooth/bluetoothledevice.go
Normal file
@ -0,0 +1,373 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package bluetooth
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureBluetoothLEDevice string = "rc(Windows.Devices.Bluetooth.BluetoothLEDevice;{b5ee2f7b-4ad8-4642-ac48-80a0b500e887})"
|
||||
|
||||
type BluetoothLEDevice struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEDevice) GetConnectionStatus() (BluetoothConnectionStatus, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEDevice))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEDevice)(unsafe.Pointer(itf))
|
||||
return v.GetConnectionStatus()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEDevice) AddConnectionStatusChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEDevice))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEDevice)(unsafe.Pointer(itf))
|
||||
return v.AddConnectionStatusChanged(handler)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEDevice) RemoveConnectionStatusChanged(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEDevice))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEDevice)(unsafe.Pointer(itf))
|
||||
return v.RemoveConnectionStatusChanged(token)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEDevice) GetGattServicesAsync() (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEDevice3))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEDevice3)(unsafe.Pointer(itf))
|
||||
return v.GetGattServicesAsync()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEDevice) GetGattServicesWithCacheModeAsync(cacheMode BluetoothCacheMode) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEDevice3))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEDevice3)(unsafe.Pointer(itf))
|
||||
return v.GetGattServicesWithCacheModeAsync(cacheMode)
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEDevice) GetBluetoothDeviceId() (*BluetoothDeviceId, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiBluetoothLEDevice4))
|
||||
defer itf.Release()
|
||||
v := (*iBluetoothLEDevice4)(unsafe.Pointer(itf))
|
||||
return v.GetBluetoothDeviceId()
|
||||
}
|
||||
|
||||
func (impl *BluetoothLEDevice) Close() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(foundation.GUIDIClosable))
|
||||
defer itf.Release()
|
||||
v := (*foundation.IClosable)(unsafe.Pointer(itf))
|
||||
return v.Close()
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEDevice string = "b5ee2f7b-4ad8-4642-ac48-80a0b500e887"
|
||||
const SignatureiBluetoothLEDevice string = "{b5ee2f7b-4ad8-4642-ac48-80a0b500e887}"
|
||||
|
||||
type iBluetoothLEDevice struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEDeviceVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDeviceId uintptr
|
||||
GetName uintptr
|
||||
GetGattServices uintptr
|
||||
GetConnectionStatus uintptr
|
||||
GetBluetoothAddress uintptr
|
||||
GetGattService uintptr
|
||||
AddNameChanged uintptr
|
||||
RemoveNameChanged uintptr
|
||||
AddGattServicesChanged uintptr
|
||||
RemoveGattServicesChanged uintptr
|
||||
AddConnectionStatusChanged uintptr
|
||||
RemoveConnectionStatusChanged uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice) VTable() *iBluetoothLEDeviceVtbl {
|
||||
return (*iBluetoothLEDeviceVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice) GetConnectionStatus() (BluetoothConnectionStatus, error) {
|
||||
var out BluetoothConnectionStatus
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetConnectionStatus,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out BluetoothConnectionStatus
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return BluetoothConnectionStatusDisconnected, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice) AddConnectionStatusChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddConnectionStatusChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice) RemoveConnectionStatusChanged(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveConnectionStatusChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEDevice2 string = "26f062b3-7aee-4d31-baba-b1b9775f5916"
|
||||
const SignatureiBluetoothLEDevice2 string = "{26f062b3-7aee-4d31-baba-b1b9775f5916}"
|
||||
|
||||
type iBluetoothLEDevice2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEDevice2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDeviceInformation uintptr
|
||||
GetAppearance uintptr
|
||||
GetBluetoothAddressType uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice2) VTable() *iBluetoothLEDevice2Vtbl {
|
||||
return (*iBluetoothLEDevice2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEDevice3 string = "aee9e493-44ac-40dc-af33-b2c13c01ca46"
|
||||
const SignatureiBluetoothLEDevice3 string = "{aee9e493-44ac-40dc-af33-b2c13c01ca46}"
|
||||
|
||||
type iBluetoothLEDevice3 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEDevice3Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDeviceAccessInformation uintptr
|
||||
RequestAccessAsync uintptr
|
||||
GetGattServicesAsync uintptr
|
||||
GetGattServicesWithCacheModeAsync uintptr
|
||||
GetGattServicesForUuidAsync uintptr
|
||||
GetGattServicesForUuidWithCacheModeAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice3) VTable() *iBluetoothLEDevice3Vtbl {
|
||||
return (*iBluetoothLEDevice3Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice3) GetGattServicesAsync() (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetGattServicesAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice3) GetGattServicesWithCacheModeAsync(cacheMode BluetoothCacheMode) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetGattServicesWithCacheModeAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(cacheMode), // in BluetoothCacheMode
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEDevice4 string = "2b605031-2248-4b2f-acf0-7cee36fc5870"
|
||||
const SignatureiBluetoothLEDevice4 string = "{2b605031-2248-4b2f-acf0-7cee36fc5870}"
|
||||
|
||||
type iBluetoothLEDevice4 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEDevice4Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetBluetoothDeviceId uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice4) VTable() *iBluetoothLEDevice4Vtbl {
|
||||
return (*iBluetoothLEDevice4Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice4) GetBluetoothDeviceId() (*BluetoothDeviceId, error) {
|
||||
var out *BluetoothDeviceId
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetBluetoothDeviceId,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out BluetoothDeviceId
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEDevice5 string = "9d6a1260-5287-458e-95ba-17c8b7bb326e"
|
||||
const SignatureiBluetoothLEDevice5 string = "{9d6a1260-5287-458e-95ba-17c8b7bb326e}"
|
||||
|
||||
type iBluetoothLEDevice5 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEDevice5Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetWasSecureConnectionUsedForPairing uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice5) VTable() *iBluetoothLEDevice5Vtbl {
|
||||
return (*iBluetoothLEDevice5Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEDevice6 string = "ca7190ef-0cae-573c-a1ca-e1fc5bfc39e2"
|
||||
const SignatureiBluetoothLEDevice6 string = "{ca7190ef-0cae-573c-a1ca-e1fc5bfc39e2}"
|
||||
|
||||
type iBluetoothLEDevice6 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEDevice6Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetConnectionParameters uintptr
|
||||
GetConnectionPhy uintptr
|
||||
RequestPreferredConnectionParameters uintptr
|
||||
AddConnectionParametersChanged uintptr
|
||||
RemoveConnectionParametersChanged uintptr
|
||||
AddConnectionPhyChanged uintptr
|
||||
RemoveConnectionPhyChanged uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDevice6) VTable() *iBluetoothLEDevice6Vtbl {
|
||||
return (*iBluetoothLEDevice6Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEDeviceStatics2 string = "5f12c06b-3bac-43e8-ad16-563271bd41c2"
|
||||
const SignatureiBluetoothLEDeviceStatics2 string = "{5f12c06b-3bac-43e8-ad16-563271bd41c2}"
|
||||
|
||||
type iBluetoothLEDeviceStatics2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEDeviceStatics2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
BluetoothLEDeviceGetDeviceSelectorFromPairingState uintptr
|
||||
BluetoothLEDeviceGetDeviceSelectorFromConnectionStatus uintptr
|
||||
BluetoothLEDeviceGetDeviceSelectorFromDeviceName uintptr
|
||||
BluetoothLEDeviceGetDeviceSelectorFromBluetoothAddress uintptr
|
||||
BluetoothLEDeviceGetDeviceSelectorFromBluetoothAddressWithBluetoothAddressType uintptr
|
||||
BluetoothLEDeviceGetDeviceSelectorFromAppearance uintptr
|
||||
BluetoothLEDeviceFromBluetoothAddressWithBluetoothAddressTypeAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDeviceStatics2) VTable() *iBluetoothLEDeviceStatics2Vtbl {
|
||||
return (*iBluetoothLEDeviceStatics2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func BluetoothLEDeviceFromBluetoothAddressWithBluetoothAddressTypeAsync(bluetoothAddress uint64, bluetoothAddressType BluetoothAddressType) (*foundation.IAsyncOperation, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Bluetooth.BluetoothLEDevice", ole.NewGUID(GUIDiBluetoothLEDeviceStatics2))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v := (*iBluetoothLEDeviceStatics2)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().BluetoothLEDeviceFromBluetoothAddressWithBluetoothAddressTypeAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(bluetoothAddress), // in uint64
|
||||
uintptr(bluetoothAddressType), // in BluetoothAddressType
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
const GUIDiBluetoothLEDeviceStatics string = "c8cf1a19-f0b6-4bf0-8689-41303de2d9f4"
|
||||
const SignatureiBluetoothLEDeviceStatics string = "{c8cf1a19-f0b6-4bf0-8689-41303de2d9f4}"
|
||||
|
||||
type iBluetoothLEDeviceStatics struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iBluetoothLEDeviceStaticsVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
BluetoothLEDeviceFromIdAsync uintptr
|
||||
BluetoothLEDeviceFromBluetoothAddressAsync uintptr
|
||||
BluetoothLEDeviceGetDeviceSelector uintptr
|
||||
}
|
||||
|
||||
func (v *iBluetoothLEDeviceStatics) VTable() *iBluetoothLEDeviceStaticsVtbl {
|
||||
return (*iBluetoothLEDeviceStaticsVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func BluetoothLEDeviceFromBluetoothAddressAsync(bluetoothAddress uint64) (*foundation.IAsyncOperation, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Bluetooth.BluetoothLEDevice", ole.NewGUID(GUIDiBluetoothLEDeviceStatics))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v := (*iBluetoothLEDeviceStatics)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().BluetoothLEDeviceFromBluetoothAddressAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(bluetoothAddress), // in uint64
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,298 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/devices/bluetooth"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureGattCharacteristic string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristic;{59cb50c1-5934-4f68-a198-eb864fa44e6b})"
|
||||
|
||||
type GattCharacteristic struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristic) GetCharacteristicProperties() (GattCharacteristicProperties, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetCharacteristicProperties()
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristic) GetUuid() (syscall.GUID, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetUuid()
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristic) ReadValueAsync() (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.ReadValueAsync()
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristic) ReadValueWithCacheModeAsync(cacheMode bluetooth.BluetoothCacheMode) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.ReadValueWithCacheModeAsync(cacheMode)
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristic) WriteValueAsync(value *streams.IBuffer) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.WriteValueAsync(value)
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristic) WriteValueWithOptionAsync(value *streams.IBuffer, writeOption GattWriteOption) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.WriteValueWithOptionAsync(value, writeOption)
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristic) WriteClientCharacteristicConfigurationDescriptorAsync(clientCharacteristicConfigurationDescriptorValue GattClientCharacteristicConfigurationDescriptorValue) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.WriteClientCharacteristicConfigurationDescriptorAsync(clientCharacteristicConfigurationDescriptorValue)
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristic) AddValueChanged(valueChangedHandler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.AddValueChanged(valueChangedHandler)
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristic) RemoveValueChanged(valueChangedEventCookie foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.RemoveValueChanged(valueChangedEventCookie)
|
||||
}
|
||||
|
||||
const GUIDiGattCharacteristic string = "59cb50c1-5934-4f68-a198-eb864fa44e6b"
|
||||
const SignatureiGattCharacteristic string = "{59cb50c1-5934-4f68-a198-eb864fa44e6b}"
|
||||
|
||||
type iGattCharacteristic struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattCharacteristicVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDescriptors uintptr
|
||||
GetCharacteristicProperties uintptr
|
||||
GetProtectionLevel uintptr
|
||||
SetProtectionLevel uintptr
|
||||
GetUserDescription uintptr
|
||||
GetUuid uintptr
|
||||
GetAttributeHandle uintptr
|
||||
GetPresentationFormats uintptr
|
||||
ReadValueAsync uintptr
|
||||
ReadValueWithCacheModeAsync uintptr
|
||||
WriteValueAsync uintptr
|
||||
WriteValueWithOptionAsync uintptr
|
||||
ReadClientCharacteristicConfigurationDescriptorAsync uintptr
|
||||
WriteClientCharacteristicConfigurationDescriptorAsync uintptr
|
||||
AddValueChanged uintptr
|
||||
RemoveValueChanged uintptr
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) VTable() *iGattCharacteristicVtbl {
|
||||
return (*iGattCharacteristicVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) GetCharacteristicProperties() (GattCharacteristicProperties, error) {
|
||||
var out GattCharacteristicProperties
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCharacteristicProperties,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattCharacteristicProperties
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattCharacteristicPropertiesNone, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) GetUuid() (syscall.GUID, error) {
|
||||
var out syscall.GUID
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetUuid,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out syscall.GUID
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return syscall.GUID{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) ReadValueAsync() (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().ReadValueAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) ReadValueWithCacheModeAsync(cacheMode bluetooth.BluetoothCacheMode) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().ReadValueWithCacheModeAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(cacheMode), // in bluetooth.BluetoothCacheMode
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) WriteValueAsync(value *streams.IBuffer) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().WriteValueAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in streams.IBuffer
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) WriteValueWithOptionAsync(value *streams.IBuffer, writeOption GattWriteOption) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().WriteValueWithOptionAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in streams.IBuffer
|
||||
uintptr(writeOption), // in GattWriteOption
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) WriteClientCharacteristicConfigurationDescriptorAsync(clientCharacteristicConfigurationDescriptorValue GattClientCharacteristicConfigurationDescriptorValue) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().WriteClientCharacteristicConfigurationDescriptorAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(clientCharacteristicConfigurationDescriptorValue), // in GattClientCharacteristicConfigurationDescriptorValue
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) AddValueChanged(valueChangedHandler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddValueChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(valueChangedHandler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic) RemoveValueChanged(valueChangedEventCookie foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveValueChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&valueChangedEventCookie)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiGattCharacteristic2 string = "ae1ab578-ec06-4764-b780-9835a1d35d6e"
|
||||
const SignatureiGattCharacteristic2 string = "{ae1ab578-ec06-4764-b780-9835a1d35d6e}"
|
||||
|
||||
type iGattCharacteristic2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattCharacteristic2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetService uintptr
|
||||
GetAllDescriptors uintptr
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic2) VTable() *iGattCharacteristic2Vtbl {
|
||||
return (*iGattCharacteristic2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
const GUIDiGattCharacteristic3 string = "3f3c663e-93d4-406b-b817-db81f8ed53b3"
|
||||
const SignatureiGattCharacteristic3 string = "{3f3c663e-93d4-406b-b817-db81f8ed53b3}"
|
||||
|
||||
type iGattCharacteristic3 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattCharacteristic3Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDescriptorsAsync uintptr
|
||||
GetDescriptorsWithCacheModeAsync uintptr
|
||||
GetDescriptorsForUuidAsync uintptr
|
||||
GetDescriptorsForUuidWithCacheModeAsync uintptr
|
||||
WriteValueWithResultAsync uintptr
|
||||
WriteValueWithResultAndOptionAsync uintptr
|
||||
WriteClientCharacteristicConfigurationDescriptorWithResultAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristic3) VTable() *iGattCharacteristic3Vtbl {
|
||||
return (*iGattCharacteristic3Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
type GattCharacteristicProperties uint32
|
||||
|
||||
const SignatureGattCharacteristicProperties string = "enum(Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristicProperties;u4)"
|
||||
|
||||
const (
|
||||
GattCharacteristicPropertiesNone GattCharacteristicProperties = 0
|
||||
GattCharacteristicPropertiesBroadcast GattCharacteristicProperties = 1
|
||||
GattCharacteristicPropertiesRead GattCharacteristicProperties = 2
|
||||
GattCharacteristicPropertiesWriteWithoutResponse GattCharacteristicProperties = 4
|
||||
GattCharacteristicPropertiesWrite GattCharacteristicProperties = 8
|
||||
GattCharacteristicPropertiesNotify GattCharacteristicProperties = 16
|
||||
GattCharacteristicPropertiesIndicate GattCharacteristicProperties = 32
|
||||
GattCharacteristicPropertiesAuthenticatedSignedWrites GattCharacteristicProperties = 64
|
||||
GattCharacteristicPropertiesExtendedProperties GattCharacteristicProperties = 128
|
||||
GattCharacteristicPropertiesReliableWrites GattCharacteristicProperties = 256
|
||||
GattCharacteristicPropertiesWritableAuxiliaries GattCharacteristicProperties = 512
|
||||
)
|
@ -0,0 +1,83 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation/collections"
|
||||
)
|
||||
|
||||
const SignatureGattCharacteristicsResult string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattCharacteristicsResult;{1194945c-b257-4f3e-9db7-f68bc9a9aef2})"
|
||||
|
||||
type GattCharacteristicsResult struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristicsResult) GetStatus() (GattCommunicationStatus, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristicsResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristicsResult)(unsafe.Pointer(itf))
|
||||
return v.GetStatus()
|
||||
}
|
||||
|
||||
func (impl *GattCharacteristicsResult) GetCharacteristics() (*collections.IVectorView, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattCharacteristicsResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattCharacteristicsResult)(unsafe.Pointer(itf))
|
||||
return v.GetCharacteristics()
|
||||
}
|
||||
|
||||
const GUIDiGattCharacteristicsResult string = "1194945c-b257-4f3e-9db7-f68bc9a9aef2"
|
||||
const SignatureiGattCharacteristicsResult string = "{1194945c-b257-4f3e-9db7-f68bc9a9aef2}"
|
||||
|
||||
type iGattCharacteristicsResult struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattCharacteristicsResultVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetStatus uintptr
|
||||
GetProtocolError uintptr
|
||||
GetCharacteristics uintptr
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristicsResult) VTable() *iGattCharacteristicsResultVtbl {
|
||||
return (*iGattCharacteristicsResultVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristicsResult) GetStatus() (GattCommunicationStatus, error) {
|
||||
var out GattCommunicationStatus
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetStatus,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattCommunicationStatus
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattCommunicationStatusSuccess, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattCharacteristicsResult) GetCharacteristics() (*collections.IVectorView, error) {
|
||||
var out *collections.IVectorView
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCharacteristics,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVectorView
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
type GattClientCharacteristicConfigurationDescriptorValue int32
|
||||
|
||||
const SignatureGattClientCharacteristicConfigurationDescriptorValue string = "enum(Windows.Devices.Bluetooth.GenericAttributeProfile.GattClientCharacteristicConfigurationDescriptorValue;i4)"
|
||||
|
||||
const (
|
||||
GattClientCharacteristicConfigurationDescriptorValueNone GattClientCharacteristicConfigurationDescriptorValue = 0
|
||||
GattClientCharacteristicConfigurationDescriptorValueNotify GattClientCharacteristicConfigurationDescriptorValue = 1
|
||||
GattClientCharacteristicConfigurationDescriptorValueIndicate GattClientCharacteristicConfigurationDescriptorValue = 2
|
||||
)
|
@ -0,0 +1,144 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureGattClientNotificationResult string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattClientNotificationResult;{506d5599-0112-419a-8e3b-ae21afabd2c2})"
|
||||
|
||||
type GattClientNotificationResult struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattClientNotificationResult) GetSubscribedClient() (*GattSubscribedClient, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattClientNotificationResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattClientNotificationResult)(unsafe.Pointer(itf))
|
||||
return v.GetSubscribedClient()
|
||||
}
|
||||
|
||||
func (impl *GattClientNotificationResult) GetStatus() (GattCommunicationStatus, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattClientNotificationResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattClientNotificationResult)(unsafe.Pointer(itf))
|
||||
return v.GetStatus()
|
||||
}
|
||||
|
||||
func (impl *GattClientNotificationResult) GetProtocolError() (*foundation.IReference, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattClientNotificationResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattClientNotificationResult)(unsafe.Pointer(itf))
|
||||
return v.GetProtocolError()
|
||||
}
|
||||
|
||||
func (impl *GattClientNotificationResult) GetBytesSent() (uint16, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattClientNotificationResult2))
|
||||
defer itf.Release()
|
||||
v := (*iGattClientNotificationResult2)(unsafe.Pointer(itf))
|
||||
return v.GetBytesSent()
|
||||
}
|
||||
|
||||
const GUIDiGattClientNotificationResult string = "506d5599-0112-419a-8e3b-ae21afabd2c2"
|
||||
const SignatureiGattClientNotificationResult string = "{506d5599-0112-419a-8e3b-ae21afabd2c2}"
|
||||
|
||||
type iGattClientNotificationResult struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattClientNotificationResultVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetSubscribedClient uintptr
|
||||
GetStatus uintptr
|
||||
GetProtocolError uintptr
|
||||
}
|
||||
|
||||
func (v *iGattClientNotificationResult) VTable() *iGattClientNotificationResultVtbl {
|
||||
return (*iGattClientNotificationResultVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattClientNotificationResult) GetSubscribedClient() (*GattSubscribedClient, error) {
|
||||
var out *GattSubscribedClient
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetSubscribedClient,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattSubscribedClient
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattClientNotificationResult) GetStatus() (GattCommunicationStatus, error) {
|
||||
var out GattCommunicationStatus
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetStatus,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattCommunicationStatus
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattCommunicationStatusSuccess, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattClientNotificationResult) GetProtocolError() (*foundation.IReference, error) {
|
||||
var out *foundation.IReference
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetProtocolError,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IReference
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
const GUIDiGattClientNotificationResult2 string = "8faec497-45e0-497e-9582-29a1fe281ad5"
|
||||
const SignatureiGattClientNotificationResult2 string = "{8faec497-45e0-497e-9582-29a1fe281ad5}"
|
||||
|
||||
type iGattClientNotificationResult2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattClientNotificationResult2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetBytesSent uintptr
|
||||
}
|
||||
|
||||
func (v *iGattClientNotificationResult2) VTable() *iGattClientNotificationResult2Vtbl {
|
||||
return (*iGattClientNotificationResult2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattClientNotificationResult2) GetBytesSent() (uint16, error) {
|
||||
var out uint16
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetBytesSent,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint16
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
type GattCommunicationStatus int32
|
||||
|
||||
const SignatureGattCommunicationStatus string = "enum(Windows.Devices.Bluetooth.GenericAttributeProfile.GattCommunicationStatus;i4)"
|
||||
|
||||
const (
|
||||
GattCommunicationStatusSuccess GattCommunicationStatus = 0
|
||||
GattCommunicationStatusUnreachable GattCommunicationStatus = 1
|
||||
GattCommunicationStatusProtocolError GattCommunicationStatus = 2
|
||||
GattCommunicationStatusAccessDenied GattCommunicationStatus = 3
|
||||
)
|
@ -0,0 +1,165 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/devices/bluetooth"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureGattDeviceService string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService;{ac7b7c05-b33c-47cf-990f-6b8f5577df71})"
|
||||
|
||||
type GattDeviceService struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattDeviceService) GetUuid() (syscall.GUID, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattDeviceService))
|
||||
defer itf.Release()
|
||||
v := (*iGattDeviceService)(unsafe.Pointer(itf))
|
||||
return v.GetUuid()
|
||||
}
|
||||
|
||||
func (impl *GattDeviceService) Close() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(foundation.GUIDIClosable))
|
||||
defer itf.Release()
|
||||
v := (*foundation.IClosable)(unsafe.Pointer(itf))
|
||||
return v.Close()
|
||||
}
|
||||
|
||||
func (impl *GattDeviceService) GetCharacteristicsAsync() (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattDeviceService3))
|
||||
defer itf.Release()
|
||||
v := (*iGattDeviceService3)(unsafe.Pointer(itf))
|
||||
return v.GetCharacteristicsAsync()
|
||||
}
|
||||
|
||||
func (impl *GattDeviceService) GetCharacteristicsWithCacheModeAsync(cacheMode bluetooth.BluetoothCacheMode) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattDeviceService3))
|
||||
defer itf.Release()
|
||||
v := (*iGattDeviceService3)(unsafe.Pointer(itf))
|
||||
return v.GetCharacteristicsWithCacheModeAsync(cacheMode)
|
||||
}
|
||||
|
||||
const GUIDiGattDeviceService string = "ac7b7c05-b33c-47cf-990f-6b8f5577df71"
|
||||
const SignatureiGattDeviceService string = "{ac7b7c05-b33c-47cf-990f-6b8f5577df71}"
|
||||
|
||||
type iGattDeviceService struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattDeviceServiceVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetCharacteristics uintptr
|
||||
GetIncludedServices uintptr
|
||||
GetDeviceId uintptr
|
||||
GetUuid uintptr
|
||||
GetAttributeHandle uintptr
|
||||
}
|
||||
|
||||
func (v *iGattDeviceService) VTable() *iGattDeviceServiceVtbl {
|
||||
return (*iGattDeviceServiceVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattDeviceService) GetUuid() (syscall.GUID, error) {
|
||||
var out syscall.GUID
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetUuid,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out syscall.GUID
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return syscall.GUID{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
const GUIDiGattDeviceService2 string = "fc54520b-0b0d-4708-bae0-9ffd9489bc59"
|
||||
const SignatureiGattDeviceService2 string = "{fc54520b-0b0d-4708-bae0-9ffd9489bc59}"
|
||||
|
||||
type iGattDeviceService2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattDeviceService2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDevice uintptr
|
||||
GetParentServices uintptr
|
||||
GetAllCharacteristics uintptr
|
||||
GetAllIncludedServices uintptr
|
||||
}
|
||||
|
||||
func (v *iGattDeviceService2) VTable() *iGattDeviceService2Vtbl {
|
||||
return (*iGattDeviceService2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
const GUIDiGattDeviceService3 string = "b293a950-0c53-437c-a9b3-5c3210c6e569"
|
||||
const SignatureiGattDeviceService3 string = "{b293a950-0c53-437c-a9b3-5c3210c6e569}"
|
||||
|
||||
type iGattDeviceService3 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattDeviceService3Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDeviceAccessInformation uintptr
|
||||
GetSession uintptr
|
||||
GetSharingMode uintptr
|
||||
RequestAccessAsync uintptr
|
||||
OpenAsync uintptr
|
||||
GetCharacteristicsAsync uintptr
|
||||
GetCharacteristicsWithCacheModeAsync uintptr
|
||||
GetCharacteristicsForUuidAsync uintptr
|
||||
GetCharacteristicsForUuidWithCacheModeAsync uintptr
|
||||
GetIncludedServicesAsync uintptr
|
||||
GetIncludedServicesWithCacheModeAsync uintptr
|
||||
GetIncludedServicesForUuidAsync uintptr
|
||||
GetIncludedServicesForUuidWithCacheModeAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iGattDeviceService3) VTable() *iGattDeviceService3Vtbl {
|
||||
return (*iGattDeviceService3Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattDeviceService3) GetCharacteristicsAsync() (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCharacteristicsAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattDeviceService3) GetCharacteristicsWithCacheModeAsync(cacheMode bluetooth.BluetoothCacheMode) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCharacteristicsWithCacheModeAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(cacheMode), // in bluetooth.BluetoothCacheMode
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation/collections"
|
||||
)
|
||||
|
||||
const SignatureGattDeviceServicesResult string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceServicesResult;{171dd3ee-016d-419d-838a-576cf475a3d8})"
|
||||
|
||||
type GattDeviceServicesResult struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattDeviceServicesResult) GetStatus() (GattCommunicationStatus, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattDeviceServicesResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattDeviceServicesResult)(unsafe.Pointer(itf))
|
||||
return v.GetStatus()
|
||||
}
|
||||
|
||||
func (impl *GattDeviceServicesResult) GetServices() (*collections.IVectorView, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattDeviceServicesResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattDeviceServicesResult)(unsafe.Pointer(itf))
|
||||
return v.GetServices()
|
||||
}
|
||||
|
||||
const GUIDiGattDeviceServicesResult string = "171dd3ee-016d-419d-838a-576cf475a3d8"
|
||||
const SignatureiGattDeviceServicesResult string = "{171dd3ee-016d-419d-838a-576cf475a3d8}"
|
||||
|
||||
type iGattDeviceServicesResult struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattDeviceServicesResultVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetStatus uintptr
|
||||
GetProtocolError uintptr
|
||||
GetServices uintptr
|
||||
}
|
||||
|
||||
func (v *iGattDeviceServicesResult) VTable() *iGattDeviceServicesResultVtbl {
|
||||
return (*iGattDeviceServicesResultVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattDeviceServicesResult) GetStatus() (GattCommunicationStatus, error) {
|
||||
var out GattCommunicationStatus
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetStatus,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattCommunicationStatus
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattCommunicationStatusSuccess, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattDeviceServicesResult) GetServices() (*collections.IVectorView, error) {
|
||||
var out *collections.IVectorView
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetServices,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVectorView
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,459 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation/collections"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureGattLocalCharacteristic string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattLocalCharacteristic;{aede376d-5412-4d74-92a8-8deb8526829c})"
|
||||
|
||||
type GattLocalCharacteristic struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) GetUuid() (syscall.GUID, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetUuid()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) GetStaticValue() (*streams.IBuffer, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetStaticValue()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) GetCharacteristicProperties() (GattCharacteristicProperties, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetCharacteristicProperties()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) GetReadProtectionLevel() (GattProtectionLevel, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetReadProtectionLevel()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) GetWriteProtectionLevel() (GattProtectionLevel, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetWriteProtectionLevel()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) CreateDescriptorAsync(descriptorUuid syscall.GUID, parameters *GattLocalDescriptorParameters) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.CreateDescriptorAsync(descriptorUuid, parameters)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) GetDescriptors() (*collections.IVectorView, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetDescriptors()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) GetUserDescription() (string, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetUserDescription()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) GetPresentationFormats() (*collections.IVectorView, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetPresentationFormats()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) GetSubscribedClients() (*collections.IVectorView, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.GetSubscribedClients()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) AddSubscribedClientsChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.AddSubscribedClientsChanged(handler)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) RemoveSubscribedClientsChanged(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.RemoveSubscribedClientsChanged(token)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) AddReadRequested(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.AddReadRequested(handler)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) RemoveReadRequested(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.RemoveReadRequested(token)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) AddWriteRequested(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.AddWriteRequested(handler)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) RemoveWriteRequested(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.RemoveWriteRequested(token)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) NotifyValueAsync(value *streams.IBuffer) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.NotifyValueAsync(value)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristic) NotifyValueForSubscribedClientAsync(value *streams.IBuffer, subscribedClient *GattSubscribedClient) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristic))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristic)(unsafe.Pointer(itf))
|
||||
return v.NotifyValueForSubscribedClientAsync(value, subscribedClient)
|
||||
}
|
||||
|
||||
const GUIDiGattLocalCharacteristic string = "aede376d-5412-4d74-92a8-8deb8526829c"
|
||||
const SignatureiGattLocalCharacteristic string = "{aede376d-5412-4d74-92a8-8deb8526829c}"
|
||||
|
||||
type iGattLocalCharacteristic struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattLocalCharacteristicVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetUuid uintptr
|
||||
GetStaticValue uintptr
|
||||
GetCharacteristicProperties uintptr
|
||||
GetReadProtectionLevel uintptr
|
||||
GetWriteProtectionLevel uintptr
|
||||
CreateDescriptorAsync uintptr
|
||||
GetDescriptors uintptr
|
||||
GetUserDescription uintptr
|
||||
GetPresentationFormats uintptr
|
||||
GetSubscribedClients uintptr
|
||||
AddSubscribedClientsChanged uintptr
|
||||
RemoveSubscribedClientsChanged uintptr
|
||||
AddReadRequested uintptr
|
||||
RemoveReadRequested uintptr
|
||||
AddWriteRequested uintptr
|
||||
RemoveWriteRequested uintptr
|
||||
NotifyValueAsync uintptr
|
||||
NotifyValueForSubscribedClientAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) VTable() *iGattLocalCharacteristicVtbl {
|
||||
return (*iGattLocalCharacteristicVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) GetUuid() (syscall.GUID, error) {
|
||||
var out syscall.GUID
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetUuid,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out syscall.GUID
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return syscall.GUID{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) GetStaticValue() (*streams.IBuffer, error) {
|
||||
var out *streams.IBuffer
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetStaticValue,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) GetCharacteristicProperties() (GattCharacteristicProperties, error) {
|
||||
var out GattCharacteristicProperties
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCharacteristicProperties,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattCharacteristicProperties
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattCharacteristicPropertiesNone, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) GetReadProtectionLevel() (GattProtectionLevel, error) {
|
||||
var out GattProtectionLevel
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetReadProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattProtectionLevelPlain, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) GetWriteProtectionLevel() (GattProtectionLevel, error) {
|
||||
var out GattProtectionLevel
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetWriteProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattProtectionLevelPlain, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) CreateDescriptorAsync(descriptorUuid syscall.GUID, parameters *GattLocalDescriptorParameters) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().CreateDescriptorAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&descriptorUuid)), // in syscall.GUID
|
||||
uintptr(unsafe.Pointer(parameters)), // in GattLocalDescriptorParameters
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) GetDescriptors() (*collections.IVectorView, error) {
|
||||
var out *collections.IVectorView
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetDescriptors,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVectorView
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) GetUserDescription() (string, error) {
|
||||
var outHStr ole.HString
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetUserDescription,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&outHStr)), // out string
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return "", ole.NewError(hr)
|
||||
}
|
||||
|
||||
out := outHStr.String()
|
||||
ole.DeleteHString(outHStr)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) GetPresentationFormats() (*collections.IVectorView, error) {
|
||||
var out *collections.IVectorView
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetPresentationFormats,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVectorView
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) GetSubscribedClients() (*collections.IVectorView, error) {
|
||||
var out *collections.IVectorView
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetSubscribedClients,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVectorView
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) AddSubscribedClientsChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddSubscribedClientsChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) RemoveSubscribedClientsChanged(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveSubscribedClientsChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) AddReadRequested(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddReadRequested,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) RemoveReadRequested(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveReadRequested,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) AddWriteRequested(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddWriteRequested,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) RemoveWriteRequested(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveWriteRequested,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) NotifyValueAsync(value *streams.IBuffer) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().NotifyValueAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in streams.IBuffer
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristic) NotifyValueForSubscribedClientAsync(value *streams.IBuffer, subscribedClient *GattSubscribedClient) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().NotifyValueForSubscribedClientAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in streams.IBuffer
|
||||
uintptr(unsafe.Pointer(subscribedClient)), // in GattSubscribedClient
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,299 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation/collections"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureGattLocalCharacteristicParameters string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattLocalCharacteristicParameters;{faf73db4-4cff-44c7-8445-040e6ead0063})"
|
||||
|
||||
type GattLocalCharacteristicParameters struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func NewGattLocalCharacteristicParameters() (*GattLocalCharacteristicParameters, error) {
|
||||
inspectable, err := ole.RoActivateInstance("Windows.Devices.Bluetooth.GenericAttributeProfile.GattLocalCharacteristicParameters")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return (*GattLocalCharacteristicParameters)(unsafe.Pointer(inspectable)), nil
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) SetStaticValue(value *streams.IBuffer) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.SetStaticValue(value)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) GetStaticValue() (*streams.IBuffer, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.GetStaticValue()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) SetCharacteristicProperties(value GattCharacteristicProperties) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.SetCharacteristicProperties(value)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) GetCharacteristicProperties() (GattCharacteristicProperties, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.GetCharacteristicProperties()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) SetReadProtectionLevel(value GattProtectionLevel) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.SetReadProtectionLevel(value)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) GetReadProtectionLevel() (GattProtectionLevel, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.GetReadProtectionLevel()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) SetWriteProtectionLevel(value GattProtectionLevel) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.SetWriteProtectionLevel(value)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) GetWriteProtectionLevel() (GattProtectionLevel, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.GetWriteProtectionLevel()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) SetUserDescription(value string) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.SetUserDescription(value)
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) GetUserDescription() (string, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.GetUserDescription()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicParameters) GetPresentationFormats() (*collections.IVector, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicParameters)(unsafe.Pointer(itf))
|
||||
return v.GetPresentationFormats()
|
||||
}
|
||||
|
||||
const GUIDiGattLocalCharacteristicParameters string = "faf73db4-4cff-44c7-8445-040e6ead0063"
|
||||
const SignatureiGattLocalCharacteristicParameters string = "{faf73db4-4cff-44c7-8445-040e6ead0063}"
|
||||
|
||||
type iGattLocalCharacteristicParameters struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattLocalCharacteristicParametersVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
SetStaticValue uintptr
|
||||
GetStaticValue uintptr
|
||||
SetCharacteristicProperties uintptr
|
||||
GetCharacteristicProperties uintptr
|
||||
SetReadProtectionLevel uintptr
|
||||
GetReadProtectionLevel uintptr
|
||||
SetWriteProtectionLevel uintptr
|
||||
GetWriteProtectionLevel uintptr
|
||||
SetUserDescription uintptr
|
||||
GetUserDescription uintptr
|
||||
GetPresentationFormats uintptr
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) VTable() *iGattLocalCharacteristicParametersVtbl {
|
||||
return (*iGattLocalCharacteristicParametersVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) SetStaticValue(value *streams.IBuffer) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetStaticValue,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) GetStaticValue() (*streams.IBuffer, error) {
|
||||
var out *streams.IBuffer
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetStaticValue,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) SetCharacteristicProperties(value GattCharacteristicProperties) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetCharacteristicProperties,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in GattCharacteristicProperties
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) GetCharacteristicProperties() (GattCharacteristicProperties, error) {
|
||||
var out GattCharacteristicProperties
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCharacteristicProperties,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattCharacteristicProperties
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattCharacteristicPropertiesNone, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) SetReadProtectionLevel(value GattProtectionLevel) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetReadProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) GetReadProtectionLevel() (GattProtectionLevel, error) {
|
||||
var out GattProtectionLevel
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetReadProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattProtectionLevelPlain, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) SetWriteProtectionLevel(value GattProtectionLevel) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetWriteProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) GetWriteProtectionLevel() (GattProtectionLevel, error) {
|
||||
var out GattProtectionLevel
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetWriteProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattProtectionLevelPlain, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) SetUserDescription(value string) error {
|
||||
valueHStr, err := ole.NewHString(value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetUserDescription,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(valueHStr), // in string
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) GetUserDescription() (string, error) {
|
||||
var outHStr ole.HString
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetUserDescription,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&outHStr)), // out string
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return "", ole.NewError(hr)
|
||||
}
|
||||
|
||||
out := outHStr.String()
|
||||
ole.DeleteHString(outHStr)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicParameters) GetPresentationFormats() (*collections.IVector, error) {
|
||||
var out *collections.IVector
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetPresentationFormats,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVector
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/devices/bluetooth"
|
||||
)
|
||||
|
||||
const SignatureGattLocalCharacteristicResult string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattLocalCharacteristicResult;{7975de9b-0170-4397-9666-92f863f12ee6})"
|
||||
|
||||
type GattLocalCharacteristicResult struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicResult) GetCharacteristic() (*GattLocalCharacteristic, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicResult)(unsafe.Pointer(itf))
|
||||
return v.GetCharacteristic()
|
||||
}
|
||||
|
||||
func (impl *GattLocalCharacteristicResult) GetError() (bluetooth.BluetoothError, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalCharacteristicResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalCharacteristicResult)(unsafe.Pointer(itf))
|
||||
return v.GetError()
|
||||
}
|
||||
|
||||
const GUIDiGattLocalCharacteristicResult string = "7975de9b-0170-4397-9666-92f863f12ee6"
|
||||
const SignatureiGattLocalCharacteristicResult string = "{7975de9b-0170-4397-9666-92f863f12ee6}"
|
||||
|
||||
type iGattLocalCharacteristicResult struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattLocalCharacteristicResultVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetCharacteristic uintptr
|
||||
GetError uintptr
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicResult) VTable() *iGattLocalCharacteristicResultVtbl {
|
||||
return (*iGattLocalCharacteristicResultVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicResult) GetCharacteristic() (*GattLocalCharacteristic, error) {
|
||||
var out *GattLocalCharacteristic
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCharacteristic,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattLocalCharacteristic
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalCharacteristicResult) GetError() (bluetooth.BluetoothError, error) {
|
||||
var out bluetooth.BluetoothError
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetError,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bluetooth.BluetoothError
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return bluetooth.BluetoothErrorSuccess, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,179 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureGattLocalDescriptorParameters string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattLocalDescriptorParameters;{5fdede6a-f3c1-4b66-8c4b-e3d2293b40e9})"
|
||||
|
||||
type GattLocalDescriptorParameters struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func NewGattLocalDescriptorParameters() (*GattLocalDescriptorParameters, error) {
|
||||
inspectable, err := ole.RoActivateInstance("Windows.Devices.Bluetooth.GenericAttributeProfile.GattLocalDescriptorParameters")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return (*GattLocalDescriptorParameters)(unsafe.Pointer(inspectable)), nil
|
||||
}
|
||||
|
||||
func (impl *GattLocalDescriptorParameters) SetStaticValue(value *streams.IBuffer) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalDescriptorParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalDescriptorParameters)(unsafe.Pointer(itf))
|
||||
return v.SetStaticValue(value)
|
||||
}
|
||||
|
||||
func (impl *GattLocalDescriptorParameters) GetStaticValue() (*streams.IBuffer, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalDescriptorParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalDescriptorParameters)(unsafe.Pointer(itf))
|
||||
return v.GetStaticValue()
|
||||
}
|
||||
|
||||
func (impl *GattLocalDescriptorParameters) SetReadProtectionLevel(value GattProtectionLevel) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalDescriptorParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalDescriptorParameters)(unsafe.Pointer(itf))
|
||||
return v.SetReadProtectionLevel(value)
|
||||
}
|
||||
|
||||
func (impl *GattLocalDescriptorParameters) GetReadProtectionLevel() (GattProtectionLevel, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalDescriptorParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalDescriptorParameters)(unsafe.Pointer(itf))
|
||||
return v.GetReadProtectionLevel()
|
||||
}
|
||||
|
||||
func (impl *GattLocalDescriptorParameters) SetWriteProtectionLevel(value GattProtectionLevel) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalDescriptorParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalDescriptorParameters)(unsafe.Pointer(itf))
|
||||
return v.SetWriteProtectionLevel(value)
|
||||
}
|
||||
|
||||
func (impl *GattLocalDescriptorParameters) GetWriteProtectionLevel() (GattProtectionLevel, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalDescriptorParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalDescriptorParameters)(unsafe.Pointer(itf))
|
||||
return v.GetWriteProtectionLevel()
|
||||
}
|
||||
|
||||
const GUIDiGattLocalDescriptorParameters string = "5fdede6a-f3c1-4b66-8c4b-e3d2293b40e9"
|
||||
const SignatureiGattLocalDescriptorParameters string = "{5fdede6a-f3c1-4b66-8c4b-e3d2293b40e9}"
|
||||
|
||||
type iGattLocalDescriptorParameters struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattLocalDescriptorParametersVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
SetStaticValue uintptr
|
||||
GetStaticValue uintptr
|
||||
SetReadProtectionLevel uintptr
|
||||
GetReadProtectionLevel uintptr
|
||||
SetWriteProtectionLevel uintptr
|
||||
GetWriteProtectionLevel uintptr
|
||||
}
|
||||
|
||||
func (v *iGattLocalDescriptorParameters) VTable() *iGattLocalDescriptorParametersVtbl {
|
||||
return (*iGattLocalDescriptorParametersVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattLocalDescriptorParameters) SetStaticValue(value *streams.IBuffer) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetStaticValue,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalDescriptorParameters) GetStaticValue() (*streams.IBuffer, error) {
|
||||
var out *streams.IBuffer
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetStaticValue,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalDescriptorParameters) SetReadProtectionLevel(value GattProtectionLevel) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetReadProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalDescriptorParameters) GetReadProtectionLevel() (GattProtectionLevel, error) {
|
||||
var out GattProtectionLevel
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetReadProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattProtectionLevelPlain, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalDescriptorParameters) SetWriteProtectionLevel(value GattProtectionLevel) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetWriteProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalDescriptorParameters) GetWriteProtectionLevel() (GattProtectionLevel, error) {
|
||||
var out GattProtectionLevel
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetWriteProtectionLevel,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattProtectionLevel
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattProtectionLevelPlain, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation/collections"
|
||||
)
|
||||
|
||||
const SignatureGattLocalService string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattLocalService;{f513e258-f7f7-4902-b803-57fcc7d6fe83})"
|
||||
|
||||
type GattLocalService struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattLocalService) GetUuid() (syscall.GUID, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalService))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalService)(unsafe.Pointer(itf))
|
||||
return v.GetUuid()
|
||||
}
|
||||
|
||||
func (impl *GattLocalService) CreateCharacteristicAsync(characteristicUuid syscall.GUID, parameters *GattLocalCharacteristicParameters) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalService))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalService)(unsafe.Pointer(itf))
|
||||
return v.CreateCharacteristicAsync(characteristicUuid, parameters)
|
||||
}
|
||||
|
||||
func (impl *GattLocalService) GetCharacteristics() (*collections.IVectorView, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattLocalService))
|
||||
defer itf.Release()
|
||||
v := (*iGattLocalService)(unsafe.Pointer(itf))
|
||||
return v.GetCharacteristics()
|
||||
}
|
||||
|
||||
const GUIDiGattLocalService string = "f513e258-f7f7-4902-b803-57fcc7d6fe83"
|
||||
const SignatureiGattLocalService string = "{f513e258-f7f7-4902-b803-57fcc7d6fe83}"
|
||||
|
||||
type iGattLocalService struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattLocalServiceVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetUuid uintptr
|
||||
CreateCharacteristicAsync uintptr
|
||||
GetCharacteristics uintptr
|
||||
}
|
||||
|
||||
func (v *iGattLocalService) VTable() *iGattLocalServiceVtbl {
|
||||
return (*iGattLocalServiceVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattLocalService) GetUuid() (syscall.GUID, error) {
|
||||
var out syscall.GUID
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetUuid,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out syscall.GUID
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return syscall.GUID{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalService) CreateCharacteristicAsync(characteristicUuid syscall.GUID, parameters *GattLocalCharacteristicParameters) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().CreateCharacteristicAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&characteristicUuid)), // in syscall.GUID
|
||||
uintptr(unsafe.Pointer(parameters)), // in GattLocalCharacteristicParameters
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattLocalService) GetCharacteristics() (*collections.IVectorView, error) {
|
||||
var out *collections.IVectorView
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCharacteristics,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out collections.IVectorView
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
type GattProtectionLevel int32
|
||||
|
||||
const SignatureGattProtectionLevel string = "enum(Windows.Devices.Bluetooth.GenericAttributeProfile.GattProtectionLevel;i4)"
|
||||
|
||||
const (
|
||||
GattProtectionLevelPlain GattProtectionLevel = 0
|
||||
GattProtectionLevelAuthenticationRequired GattProtectionLevel = 1
|
||||
GattProtectionLevelEncryptionRequired GattProtectionLevel = 2
|
||||
GattProtectionLevelEncryptionAndAuthenticationRequired GattProtectionLevel = 3
|
||||
)
|
@ -0,0 +1,196 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureGattReadRequest string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattReadRequest;{f1dd6535-6acd-42a6-a4bb-d789dae0043e})"
|
||||
|
||||
type GattReadRequest struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattReadRequest) GetOffset() (uint32, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequest)(unsafe.Pointer(itf))
|
||||
return v.GetOffset()
|
||||
}
|
||||
|
||||
func (impl *GattReadRequest) GetLength() (uint32, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequest)(unsafe.Pointer(itf))
|
||||
return v.GetLength()
|
||||
}
|
||||
|
||||
func (impl *GattReadRequest) GetState() (GattRequestState, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequest)(unsafe.Pointer(itf))
|
||||
return v.GetState()
|
||||
}
|
||||
|
||||
func (impl *GattReadRequest) AddStateChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequest)(unsafe.Pointer(itf))
|
||||
return v.AddStateChanged(handler)
|
||||
}
|
||||
|
||||
func (impl *GattReadRequest) RemoveStateChanged(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequest)(unsafe.Pointer(itf))
|
||||
return v.RemoveStateChanged(token)
|
||||
}
|
||||
|
||||
func (impl *GattReadRequest) RespondWithValue(value *streams.IBuffer) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequest)(unsafe.Pointer(itf))
|
||||
return v.RespondWithValue(value)
|
||||
}
|
||||
|
||||
func (impl *GattReadRequest) RespondWithProtocolError(protocolError uint8) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequest)(unsafe.Pointer(itf))
|
||||
return v.RespondWithProtocolError(protocolError)
|
||||
}
|
||||
|
||||
const GUIDiGattReadRequest string = "f1dd6535-6acd-42a6-a4bb-d789dae0043e"
|
||||
const SignatureiGattReadRequest string = "{f1dd6535-6acd-42a6-a4bb-d789dae0043e}"
|
||||
|
||||
type iGattReadRequest struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattReadRequestVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetOffset uintptr
|
||||
GetLength uintptr
|
||||
GetState uintptr
|
||||
AddStateChanged uintptr
|
||||
RemoveStateChanged uintptr
|
||||
RespondWithValue uintptr
|
||||
RespondWithProtocolError uintptr
|
||||
}
|
||||
|
||||
func (v *iGattReadRequest) VTable() *iGattReadRequestVtbl {
|
||||
return (*iGattReadRequestVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattReadRequest) GetOffset() (uint32, error) {
|
||||
var out uint32
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetOffset,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint32
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattReadRequest) GetLength() (uint32, error) {
|
||||
var out uint32
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetLength,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint32
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattReadRequest) GetState() (GattRequestState, error) {
|
||||
var out GattRequestState
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetState,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattRequestState
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattRequestStatePending, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattReadRequest) AddStateChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddStateChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattReadRequest) RemoveStateChanged(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveStateChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattReadRequest) RespondWithValue(value *streams.IBuffer) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RespondWithValue,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattReadRequest) RespondWithProtocolError(protocolError uint8) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RespondWithProtocolError,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(protocolError), // in uint8
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureGattReadRequestedEventArgs string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattReadRequestedEventArgs;{93497243-f39c-484b-8ab6-996ba486cfa3})"
|
||||
|
||||
type GattReadRequestedEventArgs struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattReadRequestedEventArgs) GetSession() (*GattSession, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequestedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequestedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetSession()
|
||||
}
|
||||
|
||||
func (impl *GattReadRequestedEventArgs) GetDeferral() (*foundation.Deferral, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequestedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequestedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetDeferral()
|
||||
}
|
||||
|
||||
func (impl *GattReadRequestedEventArgs) GetRequestAsync() (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadRequestedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadRequestedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetRequestAsync()
|
||||
}
|
||||
|
||||
const GUIDiGattReadRequestedEventArgs string = "93497243-f39c-484b-8ab6-996ba486cfa3"
|
||||
const SignatureiGattReadRequestedEventArgs string = "{93497243-f39c-484b-8ab6-996ba486cfa3}"
|
||||
|
||||
type iGattReadRequestedEventArgs struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattReadRequestedEventArgsVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetSession uintptr
|
||||
GetDeferral uintptr
|
||||
GetRequestAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iGattReadRequestedEventArgs) VTable() *iGattReadRequestedEventArgsVtbl {
|
||||
return (*iGattReadRequestedEventArgsVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattReadRequestedEventArgs) GetSession() (*GattSession, error) {
|
||||
var out *GattSession
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetSession,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattSession
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattReadRequestedEventArgs) GetDeferral() (*foundation.Deferral, error) {
|
||||
var out *foundation.Deferral
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetDeferral,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.Deferral
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattReadRequestedEventArgs) GetRequestAsync() (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetRequestAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureGattReadResult string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattReadResult;{63a66f08-1aea-4c4c-a50f-97bae474b348})"
|
||||
|
||||
type GattReadResult struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattReadResult) GetStatus() (GattCommunicationStatus, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadResult)(unsafe.Pointer(itf))
|
||||
return v.GetStatus()
|
||||
}
|
||||
|
||||
func (impl *GattReadResult) GetValue() (*streams.IBuffer, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattReadResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattReadResult)(unsafe.Pointer(itf))
|
||||
return v.GetValue()
|
||||
}
|
||||
|
||||
const GUIDiGattReadResult string = "63a66f08-1aea-4c4c-a50f-97bae474b348"
|
||||
const SignatureiGattReadResult string = "{63a66f08-1aea-4c4c-a50f-97bae474b348}"
|
||||
|
||||
type iGattReadResult struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattReadResultVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetStatus uintptr
|
||||
GetValue uintptr
|
||||
}
|
||||
|
||||
func (v *iGattReadResult) VTable() *iGattReadResultVtbl {
|
||||
return (*iGattReadResultVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattReadResult) GetStatus() (GattCommunicationStatus, error) {
|
||||
var out GattCommunicationStatus
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetStatus,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattCommunicationStatus
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattCommunicationStatusSuccess, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattReadResult) GetValue() (*streams.IBuffer, error) {
|
||||
var out *streams.IBuffer
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetValue,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
const GUIDiGattReadResult2 string = "a10f50a0-fb43-48af-baaa-638a5c6329fe"
|
||||
const SignatureiGattReadResult2 string = "{a10f50a0-fb43-48af-baaa-638a5c6329fe}"
|
||||
|
||||
type iGattReadResult2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattReadResult2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetProtocolError uintptr
|
||||
}
|
||||
|
||||
func (v *iGattReadResult2) VTable() *iGattReadResult2Vtbl {
|
||||
return (*iGattReadResult2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
type GattRequestState int32
|
||||
|
||||
const SignatureGattRequestState string = "enum(Windows.Devices.Bluetooth.GenericAttributeProfile.GattRequestState;i4)"
|
||||
|
||||
const (
|
||||
GattRequestStatePending GattRequestState = 0
|
||||
GattRequestStateCompleted GattRequestState = 1
|
||||
GattRequestStateCanceled GattRequestState = 2
|
||||
)
|
@ -0,0 +1,231 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureGattServiceProvider string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattServiceProvider;{7822b3cd-2889-4f86-a051-3f0aed1c2760})"
|
||||
|
||||
type GattServiceProvider struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattServiceProvider) GetService() (*GattLocalService, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProvider))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProvider)(unsafe.Pointer(itf))
|
||||
return v.GetService()
|
||||
}
|
||||
|
||||
func (impl *GattServiceProvider) GetAdvertisementStatus() (GattServiceProviderAdvertisementStatus, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProvider))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProvider)(unsafe.Pointer(itf))
|
||||
return v.GetAdvertisementStatus()
|
||||
}
|
||||
|
||||
func (impl *GattServiceProvider) AddAdvertisementStatusChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProvider))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProvider)(unsafe.Pointer(itf))
|
||||
return v.AddAdvertisementStatusChanged(handler)
|
||||
}
|
||||
|
||||
func (impl *GattServiceProvider) RemoveAdvertisementStatusChanged(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProvider))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProvider)(unsafe.Pointer(itf))
|
||||
return v.RemoveAdvertisementStatusChanged(token)
|
||||
}
|
||||
|
||||
func (impl *GattServiceProvider) StartAdvertising() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProvider))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProvider)(unsafe.Pointer(itf))
|
||||
return v.StartAdvertising()
|
||||
}
|
||||
|
||||
func (impl *GattServiceProvider) StartAdvertisingWithParameters(parameters *GattServiceProviderAdvertisingParameters) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProvider))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProvider)(unsafe.Pointer(itf))
|
||||
return v.StartAdvertisingWithParameters(parameters)
|
||||
}
|
||||
|
||||
func (impl *GattServiceProvider) StopAdvertising() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProvider))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProvider)(unsafe.Pointer(itf))
|
||||
return v.StopAdvertising()
|
||||
}
|
||||
|
||||
const GUIDiGattServiceProvider string = "7822b3cd-2889-4f86-a051-3f0aed1c2760"
|
||||
const SignatureiGattServiceProvider string = "{7822b3cd-2889-4f86-a051-3f0aed1c2760}"
|
||||
|
||||
type iGattServiceProvider struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattServiceProviderVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetService uintptr
|
||||
GetAdvertisementStatus uintptr
|
||||
AddAdvertisementStatusChanged uintptr
|
||||
RemoveAdvertisementStatusChanged uintptr
|
||||
StartAdvertising uintptr
|
||||
StartAdvertisingWithParameters uintptr
|
||||
StopAdvertising uintptr
|
||||
}
|
||||
|
||||
func (v *iGattServiceProvider) VTable() *iGattServiceProviderVtbl {
|
||||
return (*iGattServiceProviderVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattServiceProvider) GetService() (*GattLocalService, error) {
|
||||
var out *GattLocalService
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetService,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattLocalService
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProvider) GetAdvertisementStatus() (GattServiceProviderAdvertisementStatus, error) {
|
||||
var out GattServiceProviderAdvertisementStatus
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetAdvertisementStatus,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattServiceProviderAdvertisementStatus
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattServiceProviderAdvertisementStatusCreated, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProvider) AddAdvertisementStatusChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddAdvertisementStatusChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProvider) RemoveAdvertisementStatusChanged(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveAdvertisementStatusChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProvider) StartAdvertising() error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().StartAdvertising,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProvider) StartAdvertisingWithParameters(parameters *GattServiceProviderAdvertisingParameters) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().StartAdvertisingWithParameters,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(parameters)), // in GattServiceProviderAdvertisingParameters
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProvider) StopAdvertising() error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().StopAdvertising,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiGattServiceProviderStatics string = "31794063-5256-4054-a4f4-7bbe7755a57e"
|
||||
const SignatureiGattServiceProviderStatics string = "{31794063-5256-4054-a4f4-7bbe7755a57e}"
|
||||
|
||||
type iGattServiceProviderStatics struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattServiceProviderStaticsVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GattServiceProviderCreateAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderStatics) VTable() *iGattServiceProviderStaticsVtbl {
|
||||
return (*iGattServiceProviderStaticsVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func GattServiceProviderCreateAsync(serviceUuid syscall.GUID) (*foundation.IAsyncOperation, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Bluetooth.GenericAttributeProfile.GattServiceProvider", ole.NewGUID(GUIDiGattServiceProviderStatics))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v := (*iGattServiceProviderStatics)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GattServiceProviderCreateAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&serviceUuid)), // in syscall.GUID
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
type GattServiceProviderAdvertisementStatus int32
|
||||
|
||||
const SignatureGattServiceProviderAdvertisementStatus string = "enum(Windows.Devices.Bluetooth.GenericAttributeProfile.GattServiceProviderAdvertisementStatus;i4)"
|
||||
|
||||
const (
|
||||
GattServiceProviderAdvertisementStatusCreated GattServiceProviderAdvertisementStatus = 0
|
||||
GattServiceProviderAdvertisementStatusStopped GattServiceProviderAdvertisementStatus = 1
|
||||
GattServiceProviderAdvertisementStatusStarted GattServiceProviderAdvertisementStatus = 2
|
||||
GattServiceProviderAdvertisementStatusAborted GattServiceProviderAdvertisementStatus = 3
|
||||
GattServiceProviderAdvertisementStatusStartedWithoutAllAdvertisementData GattServiceProviderAdvertisementStatus = 4
|
||||
)
|
@ -0,0 +1,195 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureGattServiceProviderAdvertisingParameters string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattServiceProviderAdvertisingParameters;{e2ce31ab-6315-4c22-9bd7-781dbc3d8d82})"
|
||||
|
||||
type GattServiceProviderAdvertisingParameters struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func NewGattServiceProviderAdvertisingParameters() (*GattServiceProviderAdvertisingParameters, error) {
|
||||
inspectable, err := ole.RoActivateInstance("Windows.Devices.Bluetooth.GenericAttributeProfile.GattServiceProviderAdvertisingParameters")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return (*GattServiceProviderAdvertisingParameters)(unsafe.Pointer(inspectable)), nil
|
||||
}
|
||||
|
||||
func (impl *GattServiceProviderAdvertisingParameters) SetIsConnectable(value bool) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProviderAdvertisingParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProviderAdvertisingParameters)(unsafe.Pointer(itf))
|
||||
return v.SetIsConnectable(value)
|
||||
}
|
||||
|
||||
func (impl *GattServiceProviderAdvertisingParameters) GetIsConnectable() (bool, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProviderAdvertisingParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProviderAdvertisingParameters)(unsafe.Pointer(itf))
|
||||
return v.GetIsConnectable()
|
||||
}
|
||||
|
||||
func (impl *GattServiceProviderAdvertisingParameters) SetIsDiscoverable(value bool) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProviderAdvertisingParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProviderAdvertisingParameters)(unsafe.Pointer(itf))
|
||||
return v.SetIsDiscoverable(value)
|
||||
}
|
||||
|
||||
func (impl *GattServiceProviderAdvertisingParameters) GetIsDiscoverable() (bool, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProviderAdvertisingParameters))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProviderAdvertisingParameters)(unsafe.Pointer(itf))
|
||||
return v.GetIsDiscoverable()
|
||||
}
|
||||
|
||||
func (impl *GattServiceProviderAdvertisingParameters) SetServiceData(value *streams.IBuffer) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProviderAdvertisingParameters2))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProviderAdvertisingParameters2)(unsafe.Pointer(itf))
|
||||
return v.SetServiceData(value)
|
||||
}
|
||||
|
||||
func (impl *GattServiceProviderAdvertisingParameters) GetServiceData() (*streams.IBuffer, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProviderAdvertisingParameters2))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProviderAdvertisingParameters2)(unsafe.Pointer(itf))
|
||||
return v.GetServiceData()
|
||||
}
|
||||
|
||||
const GUIDiGattServiceProviderAdvertisingParameters string = "e2ce31ab-6315-4c22-9bd7-781dbc3d8d82"
|
||||
const SignatureiGattServiceProviderAdvertisingParameters string = "{e2ce31ab-6315-4c22-9bd7-781dbc3d8d82}"
|
||||
|
||||
type iGattServiceProviderAdvertisingParameters struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattServiceProviderAdvertisingParametersVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
SetIsConnectable uintptr
|
||||
GetIsConnectable uintptr
|
||||
SetIsDiscoverable uintptr
|
||||
GetIsDiscoverable uintptr
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderAdvertisingParameters) VTable() *iGattServiceProviderAdvertisingParametersVtbl {
|
||||
return (*iGattServiceProviderAdvertisingParametersVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderAdvertisingParameters) SetIsConnectable(value bool) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetIsConnectable,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(*(*byte)(unsafe.Pointer(&value))), // in bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderAdvertisingParameters) GetIsConnectable() (bool, error) {
|
||||
var out bool
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetIsConnectable,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return false, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderAdvertisingParameters) SetIsDiscoverable(value bool) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetIsDiscoverable,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(*(*byte)(unsafe.Pointer(&value))), // in bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderAdvertisingParameters) GetIsDiscoverable() (bool, error) {
|
||||
var out bool
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetIsDiscoverable,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return false, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
const GUIDiGattServiceProviderAdvertisingParameters2 string = "ff68468d-ca92-4434-9743-0e90988ad879"
|
||||
const SignatureiGattServiceProviderAdvertisingParameters2 string = "{ff68468d-ca92-4434-9743-0e90988ad879}"
|
||||
|
||||
type iGattServiceProviderAdvertisingParameters2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattServiceProviderAdvertisingParameters2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
SetServiceData uintptr
|
||||
GetServiceData uintptr
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderAdvertisingParameters2) VTable() *iGattServiceProviderAdvertisingParameters2Vtbl {
|
||||
return (*iGattServiceProviderAdvertisingParameters2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderAdvertisingParameters2) SetServiceData(value *streams.IBuffer) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetServiceData,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderAdvertisingParameters2) GetServiceData() (*streams.IBuffer, error) {
|
||||
var out *streams.IBuffer
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetServiceData,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/devices/bluetooth"
|
||||
)
|
||||
|
||||
const SignatureGattServiceProviderResult string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattServiceProviderResult;{764696d8-c53e-428c-8a48-67afe02c3ae6})"
|
||||
|
||||
type GattServiceProviderResult struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattServiceProviderResult) GetError() (bluetooth.BluetoothError, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProviderResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProviderResult)(unsafe.Pointer(itf))
|
||||
return v.GetError()
|
||||
}
|
||||
|
||||
func (impl *GattServiceProviderResult) GetServiceProvider() (*GattServiceProvider, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattServiceProviderResult))
|
||||
defer itf.Release()
|
||||
v := (*iGattServiceProviderResult)(unsafe.Pointer(itf))
|
||||
return v.GetServiceProvider()
|
||||
}
|
||||
|
||||
const GUIDiGattServiceProviderResult string = "764696d8-c53e-428c-8a48-67afe02c3ae6"
|
||||
const SignatureiGattServiceProviderResult string = "{764696d8-c53e-428c-8a48-67afe02c3ae6}"
|
||||
|
||||
type iGattServiceProviderResult struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattServiceProviderResultVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetError uintptr
|
||||
GetServiceProvider uintptr
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderResult) VTable() *iGattServiceProviderResultVtbl {
|
||||
return (*iGattServiceProviderResultVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderResult) GetError() (bluetooth.BluetoothError, error) {
|
||||
var out bluetooth.BluetoothError
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetError,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bluetooth.BluetoothError
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return bluetooth.BluetoothErrorSuccess, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattServiceProviderResult) GetServiceProvider() (*GattServiceProvider, error) {
|
||||
var out *GattServiceProvider
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetServiceProvider,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattServiceProvider
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
224
windows/devices/bluetooth/genericattributeprofile/gattsession.go
Normal file
224
windows/devices/bluetooth/genericattributeprofile/gattsession.go
Normal file
@ -0,0 +1,224 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/devices/bluetooth"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureGattSession string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattSession;{d23b5143-e04e-4c24-999c-9c256f9856b1})"
|
||||
|
||||
type GattSession struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattSession) GetCanMaintainConnection() (bool, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSession))
|
||||
defer itf.Release()
|
||||
v := (*iGattSession)(unsafe.Pointer(itf))
|
||||
return v.GetCanMaintainConnection()
|
||||
}
|
||||
|
||||
func (impl *GattSession) SetMaintainConnection(value bool) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSession))
|
||||
defer itf.Release()
|
||||
v := (*iGattSession)(unsafe.Pointer(itf))
|
||||
return v.SetMaintainConnection(value)
|
||||
}
|
||||
|
||||
func (impl *GattSession) GetMaintainConnection() (bool, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSession))
|
||||
defer itf.Release()
|
||||
v := (*iGattSession)(unsafe.Pointer(itf))
|
||||
return v.GetMaintainConnection()
|
||||
}
|
||||
|
||||
func (impl *GattSession) GetMaxPduSize() (uint16, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSession))
|
||||
defer itf.Release()
|
||||
v := (*iGattSession)(unsafe.Pointer(itf))
|
||||
return v.GetMaxPduSize()
|
||||
}
|
||||
|
||||
func (impl *GattSession) AddMaxPduSizeChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSession))
|
||||
defer itf.Release()
|
||||
v := (*iGattSession)(unsafe.Pointer(itf))
|
||||
return v.AddMaxPduSizeChanged(handler)
|
||||
}
|
||||
|
||||
func (impl *GattSession) RemoveMaxPduSizeChanged(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSession))
|
||||
defer itf.Release()
|
||||
v := (*iGattSession)(unsafe.Pointer(itf))
|
||||
return v.RemoveMaxPduSizeChanged(token)
|
||||
}
|
||||
|
||||
func (impl *GattSession) Close() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(foundation.GUIDIClosable))
|
||||
defer itf.Release()
|
||||
v := (*foundation.IClosable)(unsafe.Pointer(itf))
|
||||
return v.Close()
|
||||
}
|
||||
|
||||
const GUIDiGattSession string = "d23b5143-e04e-4c24-999c-9c256f9856b1"
|
||||
const SignatureiGattSession string = "{d23b5143-e04e-4c24-999c-9c256f9856b1}"
|
||||
|
||||
type iGattSession struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattSessionVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDeviceId uintptr
|
||||
GetCanMaintainConnection uintptr
|
||||
SetMaintainConnection uintptr
|
||||
GetMaintainConnection uintptr
|
||||
GetMaxPduSize uintptr
|
||||
GetSessionStatus uintptr
|
||||
AddMaxPduSizeChanged uintptr
|
||||
RemoveMaxPduSizeChanged uintptr
|
||||
AddSessionStatusChanged uintptr
|
||||
RemoveSessionStatusChanged uintptr
|
||||
}
|
||||
|
||||
func (v *iGattSession) VTable() *iGattSessionVtbl {
|
||||
return (*iGattSessionVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattSession) GetCanMaintainConnection() (bool, error) {
|
||||
var out bool
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCanMaintainConnection,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return false, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattSession) SetMaintainConnection(value bool) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetMaintainConnection,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(*(*byte)(unsafe.Pointer(&value))), // in bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattSession) GetMaintainConnection() (bool, error) {
|
||||
var out bool
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetMaintainConnection,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return false, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattSession) GetMaxPduSize() (uint16, error) {
|
||||
var out uint16
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetMaxPduSize,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint16
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattSession) AddMaxPduSizeChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddMaxPduSizeChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattSession) RemoveMaxPduSizeChanged(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveMaxPduSizeChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiGattSessionStatics string = "2e65b95c-539f-4db7-82a8-73bdbbf73ebf"
|
||||
const SignatureiGattSessionStatics string = "{2e65b95c-539f-4db7-82a8-73bdbbf73ebf}"
|
||||
|
||||
type iGattSessionStatics struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattSessionStaticsVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GattSessionFromDeviceIdAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iGattSessionStatics) VTable() *iGattSessionStaticsVtbl {
|
||||
return (*iGattSessionStaticsVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func GattSessionFromDeviceIdAsync(deviceId *bluetooth.BluetoothDeviceId) (*foundation.IAsyncOperation, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Bluetooth.GenericAttributeProfile.GattSession", ole.NewGUID(GUIDiGattSessionStatics))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v := (*iGattSessionStatics)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GattSessionFromDeviceIdAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(deviceId)), // in bluetooth.BluetoothDeviceId
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureGattSubscribedClient string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattSubscribedClient;{736e9001-15a4-4ec2-9248-e3f20d463be9})"
|
||||
|
||||
type GattSubscribedClient struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattSubscribedClient) GetSession() (*GattSession, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSubscribedClient))
|
||||
defer itf.Release()
|
||||
v := (*iGattSubscribedClient)(unsafe.Pointer(itf))
|
||||
return v.GetSession()
|
||||
}
|
||||
|
||||
func (impl *GattSubscribedClient) GetMaxNotificationSize() (uint16, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSubscribedClient))
|
||||
defer itf.Release()
|
||||
v := (*iGattSubscribedClient)(unsafe.Pointer(itf))
|
||||
return v.GetMaxNotificationSize()
|
||||
}
|
||||
|
||||
func (impl *GattSubscribedClient) AddMaxNotificationSizeChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSubscribedClient))
|
||||
defer itf.Release()
|
||||
v := (*iGattSubscribedClient)(unsafe.Pointer(itf))
|
||||
return v.AddMaxNotificationSizeChanged(handler)
|
||||
}
|
||||
|
||||
func (impl *GattSubscribedClient) RemoveMaxNotificationSizeChanged(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattSubscribedClient))
|
||||
defer itf.Release()
|
||||
v := (*iGattSubscribedClient)(unsafe.Pointer(itf))
|
||||
return v.RemoveMaxNotificationSizeChanged(token)
|
||||
}
|
||||
|
||||
const GUIDiGattSubscribedClient string = "736e9001-15a4-4ec2-9248-e3f20d463be9"
|
||||
const SignatureiGattSubscribedClient string = "{736e9001-15a4-4ec2-9248-e3f20d463be9}"
|
||||
|
||||
type iGattSubscribedClient struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattSubscribedClientVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetSession uintptr
|
||||
GetMaxNotificationSize uintptr
|
||||
AddMaxNotificationSizeChanged uintptr
|
||||
RemoveMaxNotificationSizeChanged uintptr
|
||||
}
|
||||
|
||||
func (v *iGattSubscribedClient) VTable() *iGattSubscribedClientVtbl {
|
||||
return (*iGattSubscribedClientVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattSubscribedClient) GetSession() (*GattSession, error) {
|
||||
var out *GattSession
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetSession,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattSession
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattSubscribedClient) GetMaxNotificationSize() (uint16, error) {
|
||||
var out uint16
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetMaxNotificationSize,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint16
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattSubscribedClient) AddMaxNotificationSizeChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddMaxNotificationSizeChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattSubscribedClient) RemoveMaxNotificationSizeChanged(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveMaxNotificationSizeChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureGattValueChangedEventArgs string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattValueChangedEventArgs;{d21bdb54-06e3-4ed8-a263-acfac8ba7313})"
|
||||
|
||||
type GattValueChangedEventArgs struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattValueChangedEventArgs) GetCharacteristicValue() (*streams.IBuffer, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattValueChangedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iGattValueChangedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetCharacteristicValue()
|
||||
}
|
||||
|
||||
func (impl *GattValueChangedEventArgs) GetTimestamp() (foundation.DateTime, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattValueChangedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iGattValueChangedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetTimestamp()
|
||||
}
|
||||
|
||||
const GUIDiGattValueChangedEventArgs string = "d21bdb54-06e3-4ed8-a263-acfac8ba7313"
|
||||
const SignatureiGattValueChangedEventArgs string = "{d21bdb54-06e3-4ed8-a263-acfac8ba7313}"
|
||||
|
||||
type iGattValueChangedEventArgs struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattValueChangedEventArgsVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetCharacteristicValue uintptr
|
||||
GetTimestamp uintptr
|
||||
}
|
||||
|
||||
func (v *iGattValueChangedEventArgs) VTable() *iGattValueChangedEventArgsVtbl {
|
||||
return (*iGattValueChangedEventArgsVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattValueChangedEventArgs) GetCharacteristicValue() (*streams.IBuffer, error) {
|
||||
var out *streams.IBuffer
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetCharacteristicValue,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattValueChangedEventArgs) GetTimestamp() (foundation.DateTime, error) {
|
||||
var out foundation.DateTime
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetTimestamp,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.DateTime
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.DateTime{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
type GattWriteOption int32
|
||||
|
||||
const SignatureGattWriteOption string = "enum(Windows.Devices.Bluetooth.GenericAttributeProfile.GattWriteOption;i4)"
|
||||
|
||||
const (
|
||||
GattWriteOptionWriteWithResponse GattWriteOption = 0
|
||||
GattWriteOptionWriteWithoutResponse GattWriteOption = 1
|
||||
)
|
@ -0,0 +1,218 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
"github.com/saltosystems/winrt-go/windows/storage/streams"
|
||||
)
|
||||
|
||||
const SignatureGattWriteRequest string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattWriteRequest;{aeb6a9ed-de2f-4fc2-a9a8-94ea7844f13d})"
|
||||
|
||||
type GattWriteRequest struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequest) GetValue() (*streams.IBuffer, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequest)(unsafe.Pointer(itf))
|
||||
return v.GetValue()
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequest) GetOffset() (uint32, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequest)(unsafe.Pointer(itf))
|
||||
return v.GetOffset()
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequest) GetOption() (GattWriteOption, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequest)(unsafe.Pointer(itf))
|
||||
return v.GetOption()
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequest) GetState() (GattRequestState, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequest)(unsafe.Pointer(itf))
|
||||
return v.GetState()
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequest) AddStateChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequest)(unsafe.Pointer(itf))
|
||||
return v.AddStateChanged(handler)
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequest) RemoveStateChanged(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequest)(unsafe.Pointer(itf))
|
||||
return v.RemoveStateChanged(token)
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequest) Respond() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequest)(unsafe.Pointer(itf))
|
||||
return v.Respond()
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequest) RespondWithProtocolError(protocolError uint8) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequest))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequest)(unsafe.Pointer(itf))
|
||||
return v.RespondWithProtocolError(protocolError)
|
||||
}
|
||||
|
||||
const GUIDiGattWriteRequest string = "aeb6a9ed-de2f-4fc2-a9a8-94ea7844f13d"
|
||||
const SignatureiGattWriteRequest string = "{aeb6a9ed-de2f-4fc2-a9a8-94ea7844f13d}"
|
||||
|
||||
type iGattWriteRequest struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattWriteRequestVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetValue uintptr
|
||||
GetOffset uintptr
|
||||
GetOption uintptr
|
||||
GetState uintptr
|
||||
AddStateChanged uintptr
|
||||
RemoveStateChanged uintptr
|
||||
Respond uintptr
|
||||
RespondWithProtocolError uintptr
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequest) VTable() *iGattWriteRequestVtbl {
|
||||
return (*iGattWriteRequestVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequest) GetValue() (*streams.IBuffer, error) {
|
||||
var out *streams.IBuffer
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetValue,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out streams.IBuffer
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequest) GetOffset() (uint32, error) {
|
||||
var out uint32
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetOffset,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint32
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequest) GetOption() (GattWriteOption, error) {
|
||||
var out GattWriteOption
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetOption,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattWriteOption
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattWriteOptionWriteWithResponse, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequest) GetState() (GattRequestState, error) {
|
||||
var out GattRequestState
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetState,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattRequestState
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return GattRequestStatePending, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequest) AddStateChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddStateChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequest) RemoveStateChanged(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveStateChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequest) Respond() error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().Respond,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequest) RespondWithProtocolError(protocolError uint8) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RespondWithProtocolError,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(protocolError), // in uint8
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package genericattributeprofile
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureGattWriteRequestedEventArgs string = "rc(Windows.Devices.Bluetooth.GenericAttributeProfile.GattWriteRequestedEventArgs;{2dec8bbe-a73a-471a-94d5-037deadd0806})"
|
||||
|
||||
type GattWriteRequestedEventArgs struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequestedEventArgs) GetSession() (*GattSession, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequestedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequestedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetSession()
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequestedEventArgs) GetDeferral() (*foundation.Deferral, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequestedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequestedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetDeferral()
|
||||
}
|
||||
|
||||
func (impl *GattWriteRequestedEventArgs) GetRequestAsync() (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGattWriteRequestedEventArgs))
|
||||
defer itf.Release()
|
||||
v := (*iGattWriteRequestedEventArgs)(unsafe.Pointer(itf))
|
||||
return v.GetRequestAsync()
|
||||
}
|
||||
|
||||
const GUIDiGattWriteRequestedEventArgs string = "2dec8bbe-a73a-471a-94d5-037deadd0806"
|
||||
const SignatureiGattWriteRequestedEventArgs string = "{2dec8bbe-a73a-471a-94d5-037deadd0806}"
|
||||
|
||||
type iGattWriteRequestedEventArgs struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGattWriteRequestedEventArgsVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetSession uintptr
|
||||
GetDeferral uintptr
|
||||
GetRequestAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequestedEventArgs) VTable() *iGattWriteRequestedEventArgsVtbl {
|
||||
return (*iGattWriteRequestedEventArgsVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequestedEventArgs) GetSession() (*GattSession, error) {
|
||||
var out *GattSession
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetSession,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out GattSession
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequestedEventArgs) GetDeferral() (*foundation.Deferral, error) {
|
||||
var out *foundation.Deferral
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetDeferral,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.Deferral
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGattWriteRequestedEventArgs) GetRequestAsync() (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetRequestAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
606
windows/devices/geolocation/geolocator.go
Normal file
606
windows/devices/geolocation/geolocator.go
Normal file
@ -0,0 +1,606 @@
|
||||
// Code generated by winrt-go-gen. DO NOT EDIT.
|
||||
|
||||
//go:build windows
|
||||
|
||||
//nolint:all
|
||||
package geolocation
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/saltosystems/winrt-go/windows/foundation"
|
||||
)
|
||||
|
||||
const SignatureGeolocator string = "rc(Windows.Devices.Geolocation.Geolocator;{a9c3bf62-4524-4989-8aa9-de019d2e551f})"
|
||||
|
||||
type Geolocator struct {
|
||||
ole.IUnknown
|
||||
}
|
||||
|
||||
func NewGeolocator() (*Geolocator, error) {
|
||||
inspectable, err := ole.RoActivateInstance("Windows.Devices.Geolocation.Geolocator")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return (*Geolocator)(unsafe.Pointer(inspectable)), nil
|
||||
}
|
||||
|
||||
func (impl *Geolocator) GetDesiredAccuracy() (PositionAccuracy, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.GetDesiredAccuracy()
|
||||
}
|
||||
|
||||
func (impl *Geolocator) SetDesiredAccuracy(value PositionAccuracy) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.SetDesiredAccuracy(value)
|
||||
}
|
||||
|
||||
func (impl *Geolocator) GetMovementThreshold() (float64, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.GetMovementThreshold()
|
||||
}
|
||||
|
||||
func (impl *Geolocator) SetMovementThreshold(value float64) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.SetMovementThreshold(value)
|
||||
}
|
||||
|
||||
func (impl *Geolocator) GetReportInterval() (uint32, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.GetReportInterval()
|
||||
}
|
||||
|
||||
func (impl *Geolocator) SetReportInterval(value uint32) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.SetReportInterval(value)
|
||||
}
|
||||
|
||||
func (impl *Geolocator) GetLocationStatus() (PositionStatus, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.GetLocationStatus()
|
||||
}
|
||||
|
||||
func (impl *Geolocator) GetGeopositionAsync() (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.GetGeopositionAsync()
|
||||
}
|
||||
|
||||
func (impl *Geolocator) GetGeopositionAsyncWithAgeAndTimeout(maximumAge foundation.TimeSpan, timeout foundation.TimeSpan) (*foundation.IAsyncOperation, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.GetGeopositionAsyncWithAgeAndTimeout(maximumAge, timeout)
|
||||
}
|
||||
|
||||
func (impl *Geolocator) AddPositionChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.AddPositionChanged(handler)
|
||||
}
|
||||
|
||||
func (impl *Geolocator) RemovePositionChanged(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.RemovePositionChanged(token)
|
||||
}
|
||||
|
||||
func (impl *Geolocator) AddStatusChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.AddStatusChanged(handler)
|
||||
}
|
||||
|
||||
func (impl *Geolocator) RemoveStatusChanged(token foundation.EventRegistrationToken) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator)(unsafe.Pointer(itf))
|
||||
return v.RemoveStatusChanged(token)
|
||||
}
|
||||
|
||||
func (impl *Geolocator) GetDesiredAccuracyInMeters() (*foundation.IReference, error) {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocatorWithScalarAccuracy))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocatorWithScalarAccuracy)(unsafe.Pointer(itf))
|
||||
return v.GetDesiredAccuracyInMeters()
|
||||
}
|
||||
|
||||
func (impl *Geolocator) SetDesiredAccuracyInMeters(value *foundation.IReference) error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocatorWithScalarAccuracy))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocatorWithScalarAccuracy)(unsafe.Pointer(itf))
|
||||
return v.SetDesiredAccuracyInMeters(value)
|
||||
}
|
||||
|
||||
func (impl *Geolocator) AllowFallbackToConsentlessPositions() error {
|
||||
itf := impl.MustQueryInterface(ole.NewGUID(GUIDiGeolocator2))
|
||||
defer itf.Release()
|
||||
v := (*iGeolocator2)(unsafe.Pointer(itf))
|
||||
return v.AllowFallbackToConsentlessPositions()
|
||||
}
|
||||
|
||||
const GUIDiGeolocator string = "a9c3bf62-4524-4989-8aa9-de019d2e551f"
|
||||
const SignatureiGeolocator string = "{a9c3bf62-4524-4989-8aa9-de019d2e551f}"
|
||||
|
||||
type iGeolocator struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGeolocatorVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDesiredAccuracy uintptr
|
||||
SetDesiredAccuracy uintptr
|
||||
GetMovementThreshold uintptr
|
||||
SetMovementThreshold uintptr
|
||||
GetReportInterval uintptr
|
||||
SetReportInterval uintptr
|
||||
GetLocationStatus uintptr
|
||||
GetGeopositionAsync uintptr
|
||||
GetGeopositionAsyncWithAgeAndTimeout uintptr
|
||||
AddPositionChanged uintptr
|
||||
RemovePositionChanged uintptr
|
||||
AddStatusChanged uintptr
|
||||
RemoveStatusChanged uintptr
|
||||
}
|
||||
|
||||
func (v *iGeolocator) VTable() *iGeolocatorVtbl {
|
||||
return (*iGeolocatorVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGeolocator) GetDesiredAccuracy() (PositionAccuracy, error) {
|
||||
var out PositionAccuracy
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetDesiredAccuracy,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out PositionAccuracy
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return PositionAccuracyDefault, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) SetDesiredAccuracy(value PositionAccuracy) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetDesiredAccuracy,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in PositionAccuracy
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) GetMovementThreshold() (float64, error) {
|
||||
var out float64
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetMovementThreshold,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out float64
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0.0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) SetMovementThreshold(value float64) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetMovementThreshold,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in float64
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) GetReportInterval() (uint32, error) {
|
||||
var out uint32
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetReportInterval,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out uint32
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return 0, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) SetReportInterval(value uint32) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetReportInterval,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(value), // in uint32
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) GetLocationStatus() (PositionStatus, error) {
|
||||
var out PositionStatus
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetLocationStatus,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out PositionStatus
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return PositionStatusReady, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) GetGeopositionAsync() (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetGeopositionAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) GetGeopositionAsyncWithAgeAndTimeout(maximumAge foundation.TimeSpan, timeout foundation.TimeSpan) (*foundation.IAsyncOperation, error) {
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetGeopositionAsyncWithAgeAndTimeout,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&maximumAge)), // in foundation.TimeSpan
|
||||
uintptr(unsafe.Pointer(&timeout)), // in foundation.TimeSpan
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) AddPositionChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddPositionChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) RemovePositionChanged(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemovePositionChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) AddStatusChanged(handler *foundation.TypedEventHandler) (foundation.EventRegistrationToken, error) {
|
||||
var out foundation.EventRegistrationToken
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AddStatusChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(handler)), // in foundation.TypedEventHandler
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return foundation.EventRegistrationToken{}, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGeolocator) RemoveStatusChanged(token foundation.EventRegistrationToken) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().RemoveStatusChanged,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&token)), // in foundation.EventRegistrationToken
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiGeolocatorWithScalarAccuracy string = "96f5d3c1-b80f-460a-994d-a96c47a51aa4"
|
||||
const SignatureiGeolocatorWithScalarAccuracy string = "{96f5d3c1-b80f-460a-994d-a96c47a51aa4}"
|
||||
|
||||
type iGeolocatorWithScalarAccuracy struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGeolocatorWithScalarAccuracyVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GetDesiredAccuracyInMeters uintptr
|
||||
SetDesiredAccuracyInMeters uintptr
|
||||
}
|
||||
|
||||
func (v *iGeolocatorWithScalarAccuracy) VTable() *iGeolocatorWithScalarAccuracyVtbl {
|
||||
return (*iGeolocatorWithScalarAccuracyVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGeolocatorWithScalarAccuracy) GetDesiredAccuracyInMeters() (*foundation.IReference, error) {
|
||||
var out *foundation.IReference
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GetDesiredAccuracyInMeters,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IReference
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (v *iGeolocatorWithScalarAccuracy) SetDesiredAccuracyInMeters(value *foundation.IReference) error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().SetDesiredAccuracyInMeters,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in foundation.IReference
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiGeolocator2 string = "d1b42e6d-8891-43b4-ad36-27c6fe9a97b1"
|
||||
const SignatureiGeolocator2 string = "{d1b42e6d-8891-43b4-ad36-27c6fe9a97b1}"
|
||||
|
||||
type iGeolocator2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGeolocator2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
AllowFallbackToConsentlessPositions uintptr
|
||||
}
|
||||
|
||||
func (v *iGeolocator2) VTable() *iGeolocator2Vtbl {
|
||||
return (*iGeolocator2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func (v *iGeolocator2) AllowFallbackToConsentlessPositions() error {
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().AllowFallbackToConsentlessPositions,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const GUIDiGeolocatorStatics string = "9a8e7571-2df5-4591-9f87-eb5fd894e9b7"
|
||||
const SignatureiGeolocatorStatics string = "{9a8e7571-2df5-4591-9f87-eb5fd894e9b7}"
|
||||
|
||||
type iGeolocatorStatics struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGeolocatorStaticsVtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GeolocatorRequestAccessAsync uintptr
|
||||
GeolocatorGetGeopositionHistoryAsync uintptr
|
||||
GeolocatorGetGeopositionHistoryWithDurationAsync uintptr
|
||||
}
|
||||
|
||||
func (v *iGeolocatorStatics) VTable() *iGeolocatorStaticsVtbl {
|
||||
return (*iGeolocatorStaticsVtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func GeolocatorRequestAccessAsync() (*foundation.IAsyncOperation, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Geolocation.Geolocator", ole.NewGUID(GUIDiGeolocatorStatics))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v := (*iGeolocatorStatics)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GeolocatorRequestAccessAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func GeolocatorGetGeopositionHistoryAsync(startTime foundation.DateTime) (*foundation.IAsyncOperation, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Geolocation.Geolocator", ole.NewGUID(GUIDiGeolocatorStatics))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v := (*iGeolocatorStatics)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GeolocatorGetGeopositionHistoryAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&startTime)), // in foundation.DateTime
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func GeolocatorGetGeopositionHistoryWithDurationAsync(startTime foundation.DateTime, duration foundation.TimeSpan) (*foundation.IAsyncOperation, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Geolocation.Geolocator", ole.NewGUID(GUIDiGeolocatorStatics))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v := (*iGeolocatorStatics)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out *foundation.IAsyncOperation
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GeolocatorGetGeopositionHistoryWithDurationAsync,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&startTime)), // in foundation.DateTime
|
||||
uintptr(unsafe.Pointer(&duration)), // in foundation.TimeSpan
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IAsyncOperation
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
const GUIDiGeolocatorStatics2 string = "993011a2-fa1c-4631-a71d-0dbeb1250d9c"
|
||||
const SignatureiGeolocatorStatics2 string = "{993011a2-fa1c-4631-a71d-0dbeb1250d9c}"
|
||||
|
||||
type iGeolocatorStatics2 struct {
|
||||
ole.IInspectable
|
||||
}
|
||||
|
||||
type iGeolocatorStatics2Vtbl struct {
|
||||
ole.IInspectableVtbl
|
||||
|
||||
GeolocatorGetIsDefaultGeopositionRecommended uintptr
|
||||
GeolocatorSetDefaultGeoposition uintptr
|
||||
GeolocatorGetDefaultGeoposition uintptr
|
||||
}
|
||||
|
||||
func (v *iGeolocatorStatics2) VTable() *iGeolocatorStatics2Vtbl {
|
||||
return (*iGeolocatorStatics2Vtbl)(unsafe.Pointer(v.RawVTable))
|
||||
}
|
||||
|
||||
func GeolocatorGetIsDefaultGeopositionRecommended() (bool, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Geolocation.Geolocator", ole.NewGUID(GUIDiGeolocatorStatics2))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
v := (*iGeolocatorStatics2)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out bool
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GeolocatorGetIsDefaultGeopositionRecommended,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out bool
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return false, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func GeolocatorSetDefaultGeoposition(value *foundation.IReference) error {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Geolocation.Geolocator", ole.NewGUID(GUIDiGeolocatorStatics2))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
v := (*iGeolocatorStatics2)(unsafe.Pointer(inspectable))
|
||||
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GeolocatorSetDefaultGeoposition,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(value)), // in foundation.IReference
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return ole.NewError(hr)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func GeolocatorGetDefaultGeoposition() (*foundation.IReference, error) {
|
||||
inspectable, err := ole.RoGetActivationFactory("Windows.Devices.Geolocation.Geolocator", ole.NewGUID(GUIDiGeolocatorStatics2))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v := (*iGeolocatorStatics2)(unsafe.Pointer(inspectable))
|
||||
|
||||
var out *foundation.IReference
|
||||
hr, _, _ := syscall.SyscallN(
|
||||
v.VTable().GeolocatorGetDefaultGeoposition,
|
||||
uintptr(unsafe.Pointer(v)), // this
|
||||
uintptr(unsafe.Pointer(&out)), // out foundation.IReference
|
||||
)
|
||||
|
||||
if hr != 0 {
|
||||
return nil, ole.NewError(hr)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
Reference in New Issue
Block a user