jimi-iothub

所属分类:物联网
开发工具:GO
文件大小:0KB
下载次数:0
上传日期:2023-08-26 08:11:12
上 传 者sh-1993
说明:  jimi iot中心客户端,
(jimi iot hub client,)

文件列表:
LICENSE (35149, 2023-10-08)
client/ (0, 2023-10-08)
client/helper.go (4108, 2023-10-08)
client/iothub_client.go (3758, 2023-10-08)
client/iothub_config.go (1373, 2023-10-08)
client/iothub_generate_links.go (7050, 2023-10-08)
client/iothub_generate_links_test.go (4836, 2023-10-08)
client/iothub_list_avresources.go (2048, 2023-10-08)
client/iothub_list_avresources_test.go (987, 2023-10-08)
client/iothub_playback_controler.go (1831, 2023-10-08)
client/iothub_playback_controler_test.go (872, 2023-10-08)
client/iothub_playback_history.go (3307, 2023-10-08)
client/iothub_playback_history_test.go (1126, 2023-10-08)
client/iothub_realtime_controler.go (1757, 2023-10-08)
client/iothub_realtime_controler_test.go (800, 2023-10-08)
client/iothub_realtime_video.go (1889, 2023-10-08)
client/iothub_realtime_video_test.go (842, 2023-10-08)
client/iothub_send_instructions.go (2548, 2023-10-08)
client/iothub_send_instructions_test.go (722, 2023-10-08)
commands/ (0, 2023-10-08)
commands/commands.go (6821, 2023-10-08)
commands/commands_test.go (817, 2023-10-08)
commands/communication.go (5063, 2023-10-08)
commands/communication_test.go (2990, 2023-10-08)
commands/device_management.go (1597, 2023-10-08)
commands/device_management_test.go (326, 2023-10-08)
commands/video_recording.go (2835, 2023-10-08)
go.mod (493, 2023-10-08)
go.sum (4930, 2023-10-08)
mock/ (0, 2023-10-08)
mock/iothub_cleint.go (13248, 2023-10-08)
utils/ (0, 2023-10-08)
utils/utils.go (1848, 2023-10-08)
utils/utils_test.go (2345, 2023-10-08)

# jimi iothub client [![Documentation](https://img.shields.io/badge/Documentation-Read%20Now-blue.svg)](https://docs.jimicloud.com/) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) The IoT Hub Client Library for Go language is a powerful and user-friendly library designed to simplify the process of interacting with Jimi IoT Hub in Golang. This library provides an abstraction layer over the complex IoT Hub protocols, allowing developers to focus on building and managing their IoT solutions. For detailed information and usage examples, please refer to our [documentation](https://docs.jimicloud.com/). ## Features - **Device Management:** Easily manage jimi devices within the IoT Hub. - **Cloud-to-Device Communication:** Easily send cloud-to-device messages and commands. - **Command Generator:** Generate commands with ease for device control and management. - **API Integration:** Call external APIs directly from your IoT application. - **Custom Configuration:** Configure IoT Hub client behavior to match your application's requirements. - **Redis Integration:** Integrated Redis client for tracking unique request codes. ## Installation ```bash go get github.com/openfms/jimi-iothub ``` here is an exmaple of sending `STATUS` command to device ```go import iothub "github.com/openfms/jimi-iothub" func main(){ deviceImei := os.Getenv("IOTHUB_DEVICE_IMEI") ctx := context.Background() // prepare redis to track requests opts, err := redis.ParseURL(env.RedisURL) if err!=nil{ panic(err) } redisCli := redis.NewClient(opts) // prepare iothub client iothubCli, err := iothub.NewIotHubClient(env, redisCli) if err!=nil{ panic(err) } req, err := iothubCli.DeviceInstructionRequest(ctx, deviceImei, commands.GenerateCommand(commands.STATUS)) if err!=nil{ panic(err) } resp, err := iothubCli.SendDeviceInstruction(ctx, req) if err!=nil{ panic(err) } } ``` ## Interfaces We've designed two interfaces for seamless integration: one for making API calls and another for generating commands. ### Commands Explore the commands available in our IoT Hub Client Library. While we're actively developing and updating the library, we've started with popular commands. You can easily generate any command using our 'Generate Command' feature. ```Go type DeviceCommands interface { GenerateCommand(command DeviceCommand, params ...string) string CoreKitSwitch(mode CoreKitMode) string ModifyHttpUploadServer(url string) string SetHttpUploadLimit(retryCount, retryInterval uint8) string SetRtmpServer(url string) string SetFileListServer(url string) string SetTCPServer(host HostType, serverAddr string, port uint16) string CapturePicture(camera CameraType) string CaptureVideo(camera CameraType, seconds uint8) string RtmpLiveStream(OnOff OnOffState, camera CameraType, pushDuration uint8) string UploadPlaybackVideosList() string ReplayVideoList(videoNames []string) string RtmpLogin(userName, password string) string UploadHistoryVideo(timeStamp string, cameraType HistoryCameraType) string UploadEventVideo(timeStamp string, cameraType HistoryCameraType, lengthSecond uint8) string UploadEventFile(fileName string) string RecordAudio(state EnableDisable) string RecordAudioSub(state EnableDisable) string RecordSwitch(camera RecordSwitchCamera, state EnableDisable) string Mirror(state OnOffState) string Rotation(camera CameraInOut, rotation RotationDegree) string SetInwardVideoQuality(quality VideoQualityInward) string SetOutVideoQuality(quality VideoQualityOut) string VideoResolutionSub(resolution VideoResolution) string SetSpeedUnit(speedUnit VideoResolution) string ChangePassword(oldPassword, newPassword string) string SetDeviceVolume(level VolumeLevel) string SetLEDOnOff(state OnOffState) string } ``` ### Client interface ```Go type JimiIotHub interface { Stop() EndpointURL() *url.URL SendDeviceInstruction(ctx context.Context, request *InstructRequest) (*Response, error) DeviceInstructionRequest(ctx context.Context, imei string, command string) (*InstructRequest, error) RealTimeAVRequest(ctx context.Context, imei string, deviceModel DeviceModel, cmdContent *RealTimeCmdContent) (*InstructRequest, error) RealTimeAVControlRequest(ctx context.Context, imei string, deviceModel DeviceModel, cmdContent *RealTimeControlCmdContent) (*InstructRequest, error) ListAVResourcesRequest(ctx context.Context, imei string, deviceModel DeviceModel, cmdContent *AVResourceListCmdContent) (*InstructRequest, error) HistoryVideoPlaybackRequest(ctx context.Context, imei string, deviceModel DeviceModel, cmdContent *PlaybackCmdContent) (*InstructRequest, error) HistoryPlaybackControlRequest(ctx context.Context, imei string, deviceModel DeviceModel, cmdContent *PlaybackControlCmdContent) (*InstructRequest, error) } ```

近期下载者

相关文件


收藏者