Skip to content

Instantly share code, notes, and snippets.

@vsigler
vsigler / _readme.md
Last active January 25, 2023 13:20 — forked from stecman/_readme.md
Brother P-Touch PT-P300BT bluetooth driver python
View _readme.md

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@vsigler
vsigler / ModelRelationshipTest.java
Created August 16, 2013 19:43
Demonstration of valid and invalid uses of one-to-many relationship in ActiveAndroid.
View ModelRelationshipTest.java
package com.activeandroid.test;
import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;
import java.util.List;
import static junit.framework.Assert.assertEquals;
/**
* Tests model relationships.