public HashMap printLine(int type, String text) throws Exception
    {
        byte[] in_cp1251 = text.getBytes(Encoding.CP1251);
        char[] params = new char[1 + in_cp1251.length];
        params[0] = (char)type;
        for (int i = 0; i < text.length(); i++)
            params[i + 1] = (char)in_cp1251[i];

        ArrayList<Integer> answer = this.device.send(0x17, 1, params);
        if (answer.size() == 0)
            throw new Exception("Пустой ответ");

        HashMap<String, Integer> result = new HashMap<String, Integer>();
        result.put("result", answer.get(0));

        if (answer.get(0) == Status.OK)
        {
            result.put("error_code", answer.get(4));
            result.put("operator", answer.get(5));
        }

        return result;
    }