File: getPicInfo.c

package info (click to toggle)
gphoto 0.3.5-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,636 kB
  • ctags: 1,973
  • sloc: ansic: 23,035; sh: 4,851; makefile: 175
file content (46 lines) | stat: -rw-r--r-- 593 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "defs.h"
#include "getPicInfo.h"
#include "transmission.h"

qm100_packet_block qm100_getPicInfo(int serialdev, int pic)
{
  unsigned char cmd[QM100_PICINFO_LEN]=QM100_PICINFO;
  qm100_packet_block packet, ack;
  
  cmd[5]=(char)(pic>>8 & 0xff);
  cmd[6]=(char)(pic & 0xff);
  
  qm100_attention(serialdev);
  qm100_sendPacket(serialdev, cmd, sizeof(cmd));
  qm100_getAck(serialdev);

  packet = qm100_getPacket(serialdev);
  
  qm100_continueTransmission(serialdev);
  
  ack = qm100_getPacket(serialdev);
  
  qm100_endTransmit(serialdev);
 
  return (packet);
}