| | |
| | | } |
| | | } |
| | | |
| | | // Removekeys socket |
| | | func (s *Socket) Removekeys(keys []int) int { |
| | | if libbhomebus == nil || s.socket == nil { |
| | | return -1 |
| | | } |
| | | |
| | | ckey := C.create_int_array(C.int(len(keys))) |
| | | defer C.release_int_array(ckey) |
| | | if ckey == nil { |
| | | return -2 |
| | | } |
| | | |
| | | for i, v := range keys { |
| | | C.set_1_int(ckey, C.int(i), C.int(v)) |
| | | } |
| | | |
| | | return int(C.wrap_fn_shm_remove_keys(libbhomebus, ckey, C.int(len(keys)))) |
| | | } |
| | | |
| | | // RemoveOtherkeys socket |
| | | func (s *Socket) RemoveOtherkeys(keys []int) int { |
| | | if libbhomebus == nil || s.socket == nil { |
| | | return -1 |
| | | } |
| | | |
| | | ckey := C.create_int_array(C.int(len(keys))) |
| | | defer C.release_int_array(ckey) |
| | | if ckey == nil { |
| | | return -2 |
| | | } |
| | | |
| | | for i, v := range keys { |
| | | C.set_1_int(ckey, C.int(i), C.int(v)) |
| | | } |
| | | |
| | | return int(C.wrap_fn_shm_remove_keys_exclude(libbhomebus, ckey, C.int(len(keys)))) |
| | | } |
| | | |
| | | // Socket of bhomebus |
| | | type Socket struct { |
| | | socket unsafe.Pointer |
| | |
| | | return -1 |
| | | } |
| | | return 0 |
| | | } |
| | | |
| | | // Removekey socket |
| | | func (s *Socket) Removekey(key int) int { |
| | | if libbhomebus == nil || s.socket == nil { |
| | | return -1 |
| | | } |
| | | |
| | | return int(C.wrap_fn_socket_remove_key(libbhomebus, C.int(key))) |
| | | } |
| | | |
| | | // Removekeys socket |
| | | func (s *Socket) Removekeys(keys []int) int { |
| | | if libbhomebus == nil || s.socket == nil { |
| | | return -1 |
| | | } |
| | | |
| | | ckey := C.create_int_array(C.int(len(keys))) |
| | | defer C.release_int_array(ckey) |
| | | if ckey == nil { |
| | | return -2 |
| | | } |
| | | |
| | | for i, v := range keys { |
| | | C.set_1_int(ckey, C.int(i), C.int(v)) |
| | | } |
| | | |
| | | return int(C.wrap_fn_socket_remove_keys(libbhomebus, ckey, C.int(len(keys)))) |
| | | } |
| | | |
| | | // ServerSocket tcp |