Skip to content

Commit

Permalink
Update old docs
Browse files Browse the repository at this point in the history
  • Loading branch information
petabyt committed Sep 10, 2024
1 parent 37bdcbf commit b9c2700
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 68 deletions.
12 changes: 0 additions & 12 deletions docs/c.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,3 @@ Camlib read and writes all data in a single buffer. When incoming data is parsed
This reduces the number of memory allocations needed for a single transaction (generally it will be zero), and simplifies memory management.

In a multithreaded application, this buffer must be protected by a mutex. See `ptp_mutex_` functions.

## `void ptp_init(struct PtpRuntime *r);`
Initializes a `struct PtpRuntime`. The struct is pretty small. This allocates the a large buffer to `r.data`.
You may also set r.connection_type to one of `enum PtpConnType`.
## `int ptp_device_init(struct PtpRuntime *r);`
Attempts to connect to the first valid PTP device found, over USB. Returns `enum CamlibError`.
## `int ptp_open_session(struct PtpRuntime *r);`
Opens session
## `int ptp_close_session(struct PtpRuntime *r);`
Closes session, (typically shuts down camera)
## `int ptp_get_device_info(struct PtpRuntime *r, struct PtpDeviceInfo *di);`
Recieves device info into [`struct PtpDeviceInfo`](https://github.com/petabyt/camlib/blob/8291304dc94a00a57200e33a19a497f1a6ccc5b6/src/cl_data.h#L32).
29 changes: 0 additions & 29 deletions docs/camlib.md

This file was deleted.

25 changes: 0 additions & 25 deletions docs/examples.md

This file was deleted.

26 changes: 26 additions & 0 deletions docs/lua.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,29 @@ Send a custom opcode request to the camera. Have up to 5 parameters, and an opti
payload in bytes (0-255).
**Only use this if you know what you're doing.**
Sending bad data can easily brick cameras.

# Examples
```
-- Timelapse script
TAKE_X_PICS = 10
MS_BETWEEN_PICS = 100
for i = 0,TAKE_X_PICS,1 do
rc = ptp.takePicture()
if rc == ptp.IO_ERR then
uiToast("IO Error taking picture")
break
elseif rc == ptp.UNSUPPORTED then
uiToast("Remote capture is unsupported")
break
elseif rc then
uiToast("Error: " + tostring(rc))
break
else
uiToast("Took " .. tostring(i) .. "picture(s)")
end
msleep(MS_BETWEEN_PICS);
end
```
4 changes: 3 additions & 1 deletion docs/ml.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Magic Lantern PTP Ext (WIP)
# Magic Lantern PTP Ext

**draft, do not use this**

Magic Lantern had a custom PTP opcode, (`0xA1E8`) but it's been left disabled since around 2012. This is a specification
for a new opcode extension for ML, using only opcode `0x1998` (after CHDK's `0x9999`).
Expand Down
2 changes: 1 addition & 1 deletion docs/ptp.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Documentation For Camlib
# How does PTP work?
- PDF Reference for PTP and MTP: https://www.usb.org/document-library/media-transfer-protocol-v11-spec-and-mtp-v11-adopters-agreement
- PTP/IP has no free public reference :(

Expand Down

0 comments on commit b9c2700

Please sign in to comment.