Skip to content

Help using your code! #5

Description

@tomkia

I'm getting this error and wondering if you have any insight?

Cannot access 'fun a(p0: NfcA!): Unit': it is private in 'waveshare/feng/nfctag/activity/a'.

fun sendBitmap(nfcTag: NfcA, ePaperSize: Int, bitmap: Bitmap): FlashResult {
var failMsg = ""
var success = false

    try {
        // Initialize
        val connectionSuccessInt = this.mInstance.a(nfcTag)
        // Override WaveShare's SDK default of 700
        nfcTag.timeout = 1200
        if (connectionSuccessInt != 1) {
            // IO exception in nfcTag.connect()
            failMsg = "Failed to connect to tag"
        } else {
            var flashSuccessInt = -1
            flashSuccessInt = this.mInstance.a(ePaperSize, bitmap)
            if (flashSuccessInt == 1) {
                // Success!
                success = true
            } else if (flashSuccessInt == 2) {
                failMsg = "Incorrect image resolution"
            } else {
                failMsg = "Failed to write over NFC, unknown reason"
            }
        }
    } catch (e: IOException) {
        failMsg = e.toString()
        Log.v("WaveshareHandler, IO Exception", failMsg)
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions