Changeset 1097
- Timestamp:
- 03/20/11 23:56:41 (2 years ago)
- Location:
- branches/reyalp-ptp/tools/ptpcam
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reyalp-ptp/tools/ptpcam/ptp.h
r1084 r1097 920 920 // all other bits and params are reserved for future use 921 921 PTP_CHDK_ReadScriptMsg, // read next message from camera script system 922 // return param1 is message type: none, script error, script return, user, TODO chdk console data 923 // return param2 is message subtype: for script return and users this is chdk_ptp_type, for error it may be an error code (TBD) 922 // return param1 is chdk_ptp_s_msg_type 923 // return param2 is message subtype: 924 // for script return and users this is ptp_chdk_script_data_type 925 // for error it may be an error ptp_chdk_script_error_type 924 926 // return param3 is script id of script that generated the message 925 927 // return param4 is length of the message data 926 928 // return data is message. 927 // A min um of 4 bytes of zeros is returned if there would not be data otherwise929 // A minimum of 4 bytes of zeros is returned if there would not be data otherwise 928 930 PTP_CHDK_WriteScriptMsg, // write a message for scripts running on camera 929 931 // input param2 is target script id, 0=don't care. Messages for a non-running script will be discarded 930 932 // data length is handled by ptp data phase 931 933 // input messages do not have type or subtype, they are always a string destined for the script (similar to USER/string) 932 // output param1 is status (OK,queue full,wrong script,script not running)934 // output param1 is ptp_chdk_script_msg_status 933 935 } ptp_chdk_command; 934 936 … … 940 942 PTP_CHDK_TYPE_INTEGER, 941 943 PTP_CHDK_TYPE_STRING, // NOTE tables currently returned as string 942 } ptp_chdk_ type;944 } ptp_chdk_script_data_type; 943 945 944 946 // TempData flags … … 960 962 961 963 // message types 962 #define PTP_CHDK_S_MSGTYPE_NONE 0 // no messages waiting 963 #define PTP_CHDK_S_MSGTYPE_ERR 1 // error message 964 #define PTP_CHDK_S_MSGTYPE_RET 2 // script return value 965 #define PTP_CHDK_S_MSGTYPE_USER 3 // message queued by script 964 enum { 965 PTP_CHDK_S_MSGTYPE_NONE = 0, // no messages waiting 966 PTP_CHDK_S_MSGTYPE_ERR, // error message 967 PTP_CHDK_S_MSGTYPE_RET, // script return value 968 PTP_CHDK_S_MSGTYPE_USER, // message queued by script 969 // TODO chdk console data ? 970 } ptp_chdk_script_msg_type; 966 971 967 972 // error subtypes for PTP_CHDK_S_MSGTYPE_ERR and script startup status 968 #define PTP_CHDK_S_ERRTYPE_NONE 0 969 #define PTP_CHDK_S_ERRTYPE_COMPILE 1 970 #define PTP_CHDK_S_ERRTYPE_RUN 2 973 enum { 974 PTP_CHDK_S_ERRTYPE_NONE = 0, 975 PTP_CHDK_S_ERRTYPE_COMPILE, 976 PTP_CHDK_S_ERRTYPE_RUN, 977 } ptp_chdk_script_error_type; 971 978 972 979 // message status 973 #define PTP_CHDK_S_MSGSTATUS_OK 0 // queued ok 974 #define PTP_CHDK_S_MSGSTATUS_NOTRUN 1 // no script is running 975 #define PTP_CHDK_S_MSGSTATUS_QFULL 2 // queue is full 976 #define PTP_CHDK_S_MSGSTATUS_BADID 3 // specified ID is not running 980 enum { 981 PTP_CHDK_S_MSGSTATUS_OK = 0, // queued ok 982 PTP_CHDK_S_MSGSTATUS_NOTRUN, // no script is running 983 PTP_CHDK_S_MSGSTATUS_QFULL, // queue is full 984 PTP_CHDK_S_MSGSTATUS_BADID, // specified ID is not running 985 } ptp_chdk_script_msg_status; 977 986 978 987 int ptp_chdk_shutdown_hard(PTPParams* params, PTPDeviceInfo* deviceinfo); -
branches/reyalp-ptp/tools/ptpcam/ptpcam.c
r1084 r1097 2698 2698 if ( ptp_chdk_get_script_support(¶ms,¶ms.deviceinfo,&status) ) 2699 2699 { 2700 printf("script-support: %x\n",status);2700 printf("script-support:0x%x lua=%s\n",status,(status & PTP_CHDK_SCRIPT_SUPPORT_LUA) ? "yes":"no"); 2701 2701 } 2702 2702 } else if ( !strcmp("script-status",buf) ) … … 2705 2705 if ( ptp_chdk_get_script_status(¶ms,¶ms.deviceinfo,&status) ) 2706 2706 { 2707 printf("script-running:%x\n",status); 2707 printf("script-status:0x%x run=%s msg=%s\n",status, 2708 (status & PTP_CHDK_SCRIPT_STATUS_RUN) ? "yes":"no", 2709 (status & PTP_CHDK_SCRIPT_STATUS_MSG) ? "yes":"no"); 2708 2710 } 2709 2711 } else if ( !strcmp("getm",buf) )
Note: See TracChangeset
for help on using the changeset viewer.