package n9m func (e *Package) ResponseCalendar(errorCode int, errorCause string, serial int, dates []string) { e.Payload = map[string]any{ "MODULE": "STORM", "OPERATION": "GETCALENDAR", "RESPONSE": map[string]any{ "ERRORCODE": errorCode, "ERRORCAUSE": errorCause, "SERIAL": serial, "COUNT": len(dates), "CALENDER": dates, // no CHCALENDER[COUNT] // no T[COUNT] }, } } func (e *Package) RequestCalendar(queryTime string, serial int, session string, camNo int64) { channel := 1 << (camNo - 1) e.Payload = map[string]any{ "MODULE": "STORM", "OPERATION": "GETCALENDAR", "PARAMETER": map[string]any{ "CALENDARTYPE": 1, // Month data "STREAMTYPE": 1, // Main Stream "FILETYPE": 0b111111, // get file type "PICMTYPE": 0b10, // fixed timing pictures (fixed framerate) "APT0": 0xFFFFFF, // get every alarm "APT1": 0xFFFF, // get every alarm "AUDIOTYPE": 0b111, // normal recording, passenger complaints, alarm recording "CHANNEL": channel, // request all channels "QUERYTIME": queryTime, // year + month = xxxxxx "SERIAL": serial, "NEWSTREAMTYPE": 0b111, // master stream (bit1) "RFSTORAGE": 0, // 0 - hdd, 1 - sd }, "SESSION": session, } } // filenames without fileextension func (e *Package) ResponseFileList(errorCode int, errorCause string, serial int, filenames []string, fileextensions []int, ids []string) { e.Payload = map[string]any{ "MODULE": "STORM", "OPERATION": "QUERYFILELIST", "RESPONSE": map[string]any{ "ERRORCODE": errorCode, "ERRORCAUSE": errorCause, "SERIAL": serial, "SENDFILECOUNT": len(filenames), "RECORD": filenames, "FILETYPE": fileextensions, "RECORDID": ids, }, } } func (e *Package) RequestFileList(queryTime string, serial int, session string, camNo int64) { channel := 1 << (camNo - 1) e.Payload = map[string]any{ "MODULE": "STORM", "OPERATION": "QUERYFILELIST", "PARAMETER": map[string]any{ "STREAMTYPE": 1, // Main Stream "FILETYPE": 0b111111, // get all filetypes "PICMTYPE": 0b10, // fixed timing pictures (fixed framerate) "APT0": 0xFFFFFF, // get every alarm "APT1": 0xFFFF, // get every alarm "AUDIOTYPE": 0b111, // normal recording, passenger complaints, alarm recording "CHANNEL": channel, // request all channels "STARTTIME": queryTime + "000000", "ENDTIME": queryTime + "235959", "SERIAL": serial, "NEWSTREAMTYPE": 0b10, // master stream (bit1) "RFSTORAGE": 0, // 0 - hdd, 1 - sd }, "SESSION": session, } }