| | |
| | | |
| | | } |
| | | |
| | | func (api DeviceCtlApi) DevAuthApply(devId string, ip string, key string) (bool,interface{}) { |
| | | func (api DeviceCtlApi) DevAuthApply(targetIp string, fromDevId string, fromIp string, key string) (bool,interface{}) { |
| | | url := DATA_URL_PREFIX + "/devAuth/apply" |
| | | dest := &bhome_msg.BHAddress{ |
| | | Ip: []byte(ip), |
| | | Ip: []byte(targetIp), |
| | | } |
| | | netNode := append([]*bhome_msg.MsgQueryTopicReply_BHNodeAddress{}, &bhome_msg.MsgQueryTopicReply_BHNodeAddress{ |
| | | Addr: dest, |
| | |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{} { |
| | | "key": key, |
| | | "fromDevId": devId, |
| | | "fromIp": ip, |
| | | "fromDevId": fromDevId, |
| | | "fromIp": fromIp, |
| | | } |
| | | body,err := client.DoPutRequest(url,CONTENT_TYPE_JSON, paramBody,nil) |
| | | if err != nil { |