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
|
||||
)
|
Reference in New Issue
Block a user